...
1name: CI
2
3on:
4 push:
5 branches: [main]
6 pull_request:
7
8permissions:
9 contents: read
10
11jobs:
12 test:
13 name: Test
14 runs-on: ubuntu-latest
15
16 strategy:
17 # Fail fast is disabled because there are Go version specific features and tests
18 # that should be able to fail independently.
19 fail-fast: false
20 matrix:
21 os: [ubuntu-latest, macos-latest, windows-latest]
22 go: ['1.20', '1.21']
23
24 steps:
25 - name: Checkout repository
26 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27
28 - name: Set up Go
29 uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
30 with:
31 go-version: ${{ matrix.go }}
32
33 - name: Test
34 run: go test -race -v ./...
35
36 lint:
37 name: Lint
38 runs-on: ubuntu-latest
39
40 steps:
41 - name: Checkout repository
42 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
43
44 - name: Set up Nix
45 uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
46 with:
47 extra_nix_config: |
48 access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
49
50 - name: Set up magic Nix cache
51 uses: DeterminateSystems/magic-nix-cache-action@8a218f9e264e9c3803c9a1ee1c30d8e4ab55be63 # v2
52
53 - name: Prepare Nix shell
54 run: nix develop --impure .#ci
55
56 - name: Lint
57 run: nix develop --impure .#ci -c just lint
58
59 dev:
60 name: Developer environment
61 runs-on: ubuntu-latest
62
63 steps:
64 - name: Checkout repository
65 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
66
67 - name: Set up Nix
68 uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
69 with:
70 extra_nix_config: |
71 access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
72
73 - name: Set up magic Nix cache
74 uses: DeterminateSystems/magic-nix-cache-action@8a218f9e264e9c3803c9a1ee1c30d8e4ab55be63 # v2
75
76 - name: Check
77 run: nix flake check --impure
78
79 - name: Dev shell
80 run: nix develop --impure
81
82 dependency-review:
83 name: Dependency review
84 runs-on: ubuntu-latest
85 if: github.event_name == 'pull_request'
86
87 steps:
88 - name: Checkout repository
89 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
90
91 - name: Dependency Review
92 uses: actions/dependency-review-action@01bc87099ba56df1e897b6874784491ea6309bc4 # v3.1.4
View as plain text