Repository navigation
87 lines (82 loc) · 2.91 KB
/
Copy pathtest.yml
File metadata and controls
87 lines (82 loc) · 2.91 KB
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
82
83
84
85
86
87
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 }}'
build-nix-compat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v15
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-build
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v15
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix develop --command cmake -B build
- run: nix develop --command cmake --build build --target docs
- uses: shimataro/ssh-key-action@v2
if: github.ref == 'refs/heads/master' && github.repository_owner == 'arximboldi'
with:
key: ${{ secrets.SINUSOIDES_SSH_KEY }}
known_hosts: ${{ secrets.SINUSOIDES_KNOWN_HOSTS }}
- run: nix develop --command make -C build upload-docs
if: github.ref == 'refs/heads/master' && github.repository_owner == 'arximboldi'
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@v15
with:
name: arximboldi
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix develop .#${{ matrix.toolchain }} --command cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DENABLE_COVERAGE=${{ contains(matrix.opts, 'coverage') }}
- run: nix develop .#${{ matrix.toolchain }} --command cmake --build build --target check -- -j$(nproc)
- run: nix develop .#${{ matrix.toolchain }} --command bash -c "cd build && bash <(curl -s https://codecov.io/bash)"
if: ${{ contains(matrix.opts, 'coverage') }}