-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (60 loc) · 1.64 KB
/
ci.yml
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
on:
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
list-determinate-shells:
runs-on: ubuntu-22.04
outputs:
shells: ${{ steps.shells.outputs.shells }}
steps:
- uses: cachix/install-nix-action@v30
- id: shells
run: |
echo "shells=$(nix eval github:DeterminateSystems/zero-to-nix#devShells.x86_64-linux --apply builtins.attrNames --json)" >> "$GITHUB_OUTPUT"
test-determinate-shells:
needs:
- list-determinate-shells
runs-on: ubuntu-22.04
strategy:
matrix:
shell: ${{ fromJSON(needs.list-determinate-shells.outputs.shells) }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: ./
with:
arguments: github:DeterminateSystems/zero-to-nix#${{ matrix.shell }}
test-self:
strategy:
matrix:
runs-on:
- ubuntu-22.04
- macos-13
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: ./
- name: Make the nix command fail
uses: ./
with:
arguments: --a-bad-flag
id: should-fail
continue-on-error: true
- name: Fail if the action succeeded when the nix command failed
if: steps.should-fail.outcome == 'success'
run: exit 1
check:
strategy:
matrix:
runs-on:
- ubuntu-22.04
- macos-13
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- run: nix flake check --keep-going --print-build-logs --show-trace