this repo has no description
1name: Nix
2
3on:
4 push:
5 branches: ["main"]
6 pull_request:
7 branches: ["main"]
8
9jobs:
10 # Architecture-independent lints and formatting. Run once on x86_64.
11 lint:
12 runs-on: ubuntu-latest
13 steps:
14 - name: Checkout
15 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16 - name: Install Nix
17 uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
18 - name: Nix Cache
19 uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
20
21 - name: Format
22 run: nix build .#fmt
23
24 - name: Format non-Rust
25 run: nix build .#checks.x86_64-linux.treefmt
26
27 - name: Deny (audit + licenses + bans)
28 run: nix build .#deny
29
30 - name: Clippy
31 run: nix build .#clippy
32
33 - name: Build docs
34 run: nix build .#doc
35
36 # Build and test on each supported architecture.
37 build:
38 name: Build (${{ matrix.arch }})
39 runs-on: ${{ matrix.runner }}
40 strategy:
41 fail-fast: false
42 matrix:
43 include:
44 - runner: ubuntu-latest
45 arch: x86_64
46 - runner: ubuntu-24.04-arm
47 arch: aarch64
48 steps:
49 - name: Checkout
50 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
51 - name: Install Nix
52 uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
53 - name: Nix Cache
54 uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
55
56 - name: Test
57 run: nix build .#test
58
59 - name: Build cmprss
60 run: nix build .#cmprss
61
62 - name: Build static musl binary
63 run: nix build .#cmprss-static
64
65 # Run any nix checks that aren't covered by the above
66 # This should evaluate the nix expression and then do nothing
67 - name: Forgotten checks
68 run: nix flake check
69
70 # Run this separately since
71 # 1) it uses a separate set of deps, so no shared cache with the other build
72 # 2) failures here shouldn't block merging
73 coverage:
74 runs-on: ubuntu-latest
75 needs: build
76 steps:
77 - name: Checkout
78 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
79 - name: Install Nix
80 uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
81 - name: Nix Cache
82 uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
83
84 - name: Build Coverage
85 # Build and ensure the output is linked in result/
86 run: nix build -L .#coverage
87
88 # Upload code coverage
89 - name: Upload coverage to Codecov
90 uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
91 with:
92 token: ${{ secrets.CODECOV_TOKEN }}
93 files: ./result/lcov.info