Skip to content

Commit d638ad5

Browse files
committed
ci: migrate to matrix
1 parent b804463 commit d638ad5

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,39 @@ jobs:
7373
uses: cachix/install-nix-action@7ec16f2c061ab07b235a7245e06ed46fe9a1cab6 # v31.8.3
7474

7575
- name: Check flake
76-
run: nix -L flake check
76+
run: nix -L flake check --no-build
77+
78+
list-tests:
79+
name: list nix checks
80+
runs-on: ubuntu-24.04
81+
outputs:
82+
matrix: ${{ steps.generate-matrix.outputs.matrix }}
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
86+
87+
- name: Install Nix
88+
uses: cachix/install-nix-action@7ec16f2c061ab07b235a7245e06ed46fe9a1cab6 # v31.8.3
89+
90+
- name: Generate test matrix
91+
id: generate-matrix
92+
run: |
93+
matrix=$(nix flake show --json | jq -r '.checks["x86_64-linux"] | keys | tojson')
94+
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
95+
96+
test:
97+
name: "nix build .#checks.x86_64-linux.${{ matrix.name }}"
98+
needs: [ list-tests, eval ]
99+
strategy:
100+
matrix:
101+
name: ${{ fromJson(needs.list-tests.outputs.matrix) }}
102+
runs-on: ubuntu-24.04
103+
steps:
104+
- name: Checkout
105+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
106+
107+
- name: Install Nix
108+
uses: cachix/install-nix-action@7ec16f2c061ab07b235a7245e06ed46fe9a1cab6 # v31.8.3
109+
110+
- name: Run integration test
111+
run: nix -L build .#checks.x86_64-linux.${{ matrix.name }}

0 commit comments

Comments
 (0)