1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
name: test
on: [push, pull_request]
jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
build-nix:
name: "nix: ${{ matrix.name }} (${{ matrix.system }})"
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v16
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix build -L '.#${{ matrix.attr }}'
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v16
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix develop --command cmake -B build
- run: nix develop --command make -C build docs
- uses: shimataro/ssh-key-action@v2
if: github.repository_owner == 'arximboldi' && github.ref == 'refs/heads/master'
with:
key: ${{ secrets.SINUSOIDES_SSH_KEY }}
known_hosts: ${{ secrets.SINUSOIDES_KNOWN_HOSTS }}
- run: nix develop --command make -C build upload-docs
if: github.repository_owner == 'arximboldi' && github.ref == 'refs/heads/master'
check:
strategy:
matrix:
type: [Debug, Release]
toolchain: [gnu, llvm]
opts: [[]]
include:
- type: Debug
toolchain: gnu
opts: ['coverage']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v16
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- name: configure cmake
run: |
nix develop .#${{ matrix.toolchain }} --command \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.type }} \
-DENABLE_COVERAGE=${{ contains(matrix.opts, 'coverage') }}
- run: nix develop .#${{ matrix.toolchain }} --command ninja -C build check
- run: nix develop .#${{ matrix.toolchain }} --command bash -c "bash <(curl -s https://codecov.io/bash)"
if: ${{ contains(matrix.opts, 'coverage') }}
|