-
Notifications
You must be signed in to change notification settings - Fork 79
62 lines (56 loc) · 1.63 KB
/
Copy pathci.yml
File metadata and controls
62 lines (56 loc) · 1.63 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
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
evaluate:
name: Evaluate flake
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/determinate-nix-action@v3
- uses: DeterminateSystems/magic-nix-cache-action@v14
with:
use-flakehub: false
- run: nix flake show
- name: Generate build matrix
id: matrix
env:
SYSTEM: x86_64-linux
run: |
checks=$(nix eval --json ".#checks.$SYSTEM" --apply builtins.attrNames)
matrix=$(jq --compact-output --null-input \
--arg system "$SYSTEM" \
--argjson checks "$checks" \
'
{
include: ($checks | map({
name: .,
output: "checks.\($system).\(.)"
}))
}
')
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
build:
name: check ${{ matrix.name }} [x86_64-linux]
needs: evaluate
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.evaluate.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/determinate-nix-action@v3
- uses: DeterminateSystems/magic-nix-cache-action@v14
with:
use-flakehub: false
- run: nix build --print-build-logs ".#${{ matrix.output }}"