From aaa4b1737a1d8164064d859cc2e8d41c97c3738e Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sun, 3 Nov 2024 22:32:15 +0100 Subject: [PATCH] Add GitHub Actions to test compilation --- .github/workflows/test-pixi.yaml | 32 ++++++++++++++++ .github/workflows/update-pixi-lockfile.yaml | 42 +++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/test-pixi.yaml create mode 100644 .github/workflows/update-pixi-lockfile.yaml diff --git a/.github/workflows/test-pixi.yaml b/.github/workflows/test-pixi.yaml new file mode 100644 index 0000000..9550943 --- /dev/null +++ b/.github/workflows/test-pixi.yaml @@ -0,0 +1,32 @@ +name: Run tests with pixi + +on: + workflow_dispatch: + pull_request: + +jobs: + pixi-test: + name: '[pixi:${{ matrix.os }}]' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ + ubuntu-22.04, + macos-latest, + windows-2019 + ] + steps: + - uses: actions/checkout@v4 + + - name: Set up pixi + uses: prefix-dev/setup-pixi@v0.8.1 + with: + run-install: true + cache: false + + - name: Print pixi info + run: pixi info + + - name: Build and test the project + run: pixi run test diff --git a/.github/workflows/update-pixi-lockfile.yaml b/.github/workflows/update-pixi-lockfile.yaml new file mode 100644 index 0000000..779a45f --- /dev/null +++ b/.github/workflows/update-pixi-lockfile.yaml @@ -0,0 +1,42 @@ +name: Update lockfiles + +permissions: + contents: write + pull-requests: write + +on: + workflow_dispatch: + schedule: + - cron: 0 5 1 * * + +jobs: + pixi-update: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Set up pixi + uses: prefix-dev/setup-pixi@v0.8.1 + with: + run-install: false + + - name: Install pixi-diff-to-markdown + run: pixi global install pixi-diff-to-markdown + + - name: Update lockfiles + run: | + set -o pipefail + pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md + + - name: Create pull request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update pixi lockfile + title: Update pixi lockfile + body-path: diff.md + branch: update-pixi + base: main + labels: pixi + delete-branch: true + add-paths: pixi.lock