diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 1bc4622..0000000 --- a/.drone.yml +++ /dev/null @@ -1,78 +0,0 @@ -kind: pipeline -type: docker -name: archlinux - -clone: - depth: 50 - -steps: - - name: archlinux_build_test - image: archlinux:latest - pull: if-not-exists - volumes: - - name: archlinux_ccache - path: /root/.ccache - commands: - - scripts/build_archlinux.sh -volumes: - - name: archlinux_ccache - host: - path: /tmp/archlinux_ccache - ---- -kind: pipeline -type: docker -name: ubuntu - -clone: - depth: 3 - -volumes: -- name: archlinux_ccache - path: /root/.ccache - -steps: - - name: ubuntu_build_test - image: ubuntu:latest - pull: if-not-exists - volumes: - - name: ubuntu_ccache - path: /root/.ccache - environment: - commands: - - scripts/build_ubuntu.sh - - name: ubuntu_publish - image: plugins/gitea_release - settings: - files: dist/* - base_url: https:/code.ascee.nl - # when: - #branch: master - -volumes: - - name: ubuntu_ccache - host: - path: /tmp/ubuntu_ccache - ---- -kind: pipeline -type: docker -name: documentation_build_master -trigger: - branch: - master - -clone: - depth: 3 - - -steps: - - name: build_documentation_master - image: plugins/docker - settings: - repo: ascee/lasp_ascee_nl - tags: latest - username: - from_secret: docker_username - password: - from_secret: docker_password diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml new file mode 100644 index 0000000..aaaf11a --- /dev/null +++ b/.gitea/workflows/workflow.yml @@ -0,0 +1,35 @@ +name: Building and testing LASP + +on: + push: + tags: + - '*' + +jobs: + Build-Test-Ubuntu: + runs-on: ubuntu-latest + container: ascee/ubuntu_build:latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Build + run: | + pip install build + python3 -m build + + Release-Ubuntu: + runs-on: ubuntu-latest + container: ascee/ubuntu_build:latest + needs: Build-Test-Ubuntu + steps: + - name: Release + uses: actions/release-action@main + with: + files: |- + dist/** + api_key: '${{secrets.RELEASE_TOKEN}}' + if: gitea.ref == 'refs/heads/master' + diff --git a/pyproject.toml b/pyproject.toml index a24c88e..41b30ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ include = ["CMakeLists.txt", "cmake", "cpp_src", "python_src", "img", "scripts", [tool.py-build-cmake.cmake] # How to build the CMake project build_type = "Release" source_path = "." -build_args = ["-j"] +build_args = ["-j12"] install_components = ["python_modules"] [tool.py-build-cmake.editable] diff --git a/scripts/act_test b/scripts/act_test new file mode 100755 index 0000000..477332b --- /dev/null +++ b/scripts/act_test @@ -0,0 +1,3 @@ +#!/bin/bash +# Test push workflow of Gitea runner +act push --workflows .gitea/workflows diff --git a/scripts/build_ubuntu.sh b/scripts/build_test_ubuntu.sh similarity index 56% rename from scripts/build_ubuntu.sh rename to scripts/build_test_ubuntu.sh index 0b7bec2..7df11cf 100755 --- a/scripts/build_ubuntu.sh +++ b/scripts/build_test_ubuntu.sh @@ -8,13 +8,16 @@ # Stop on first error set -e # Update cache -apt update -# Install requirements -apt install -y git python3-virtualenv python3-venv libopenblas-dev python3-pip libfftw3-dev libusb-1.0-0-dev libpulse-dev python3-build -# Build -git submodule update --init --recursive +# apt update +# Install requirements, this is done inside the Docker container to safe some +# work! +# apt install -y git python3 python3-virtualenv python3-venv libopenblas-dev python3-pip libfftw3-dev libusb-1.0-0-dev libpulse-dev python3-build +# +# Build in venv python3 -m venv .venv +# Activate venv source .venv/bin/activate +# Build in venv pip install build pytest python3 -m build pip install dist/lasp-*linux_x86_64.whl