|
1 | 1 | name: Build |
2 | 2 |
|
3 | 3 | on: [push, pull_request, workflow_dispatch] |
| 4 | + |
4 | 5 | jobs: |
5 | 6 | nix: |
6 | 7 | strategy: |
7 | 8 | matrix: |
8 | 9 | package: |
9 | 10 | - hyprwire |
10 | 11 | - hyprwire-with-tests |
11 | | - |
12 | | - runs-on: ubuntu-latest |
13 | | - steps: |
14 | | - - uses: actions/checkout@v4 |
15 | | - |
16 | | - - name: Install Nix |
17 | | - uses: nixbuild/nix-quick-install-action@v31 |
18 | | - with: |
19 | | - nix_conf: | |
20 | | - keep-env-derivations = true |
21 | | - keep-outputs = true |
22 | | -
|
23 | | - - name: Restore and save Nix store |
24 | | - uses: nix-community/cache-nix-action@v6 |
25 | | - with: |
26 | | - # restore and save a cache using this key |
27 | | - primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} |
28 | | - # if there's no cache hit, restore a cache by this prefix |
29 | | - restore-prefixes-first-match: nix-${{ runner.os }}- |
30 | | - # collect garbage until the Nix store size (in bytes) is at most this number |
31 | | - # before trying to save a new cache |
32 | | - # 1G = 1073741824 |
33 | | - gc-max-store-size-linux: 1G |
34 | | - # do purge caches |
35 | | - purge: true |
36 | | - # purge all versions of the cache |
37 | | - purge-prefixes: nix-${{ runner.os }}- |
38 | | - # created more than this number of seconds ago |
39 | | - purge-created: 0 |
40 | | - # or, last accessed more than this number of seconds ago |
41 | | - # relative to the start of the `Post Restore and save Nix store` phase |
42 | | - purge-last-accessed: 0 |
43 | | - # except any version with the key that is the same as the `primary-key` |
44 | | - purge-primary-key: never |
45 | | - |
46 | | - # not needed (yet) |
47 | | - # - uses: cachix/cachix-action@v12 |
48 | | - # with: |
49 | | - # name: hyprland |
50 | | - # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
51 | | - |
52 | | - - name: Build |
53 | | - run: nix build .#${{ matrix.package }} --print-build-logs |
| 12 | + uses: hyprwm/actions/.github/workflows/nix.yml@simplify |
| 13 | + secrets: inherit |
| 14 | + with: |
| 15 | + command: nix build .#${{ matrix.package }} --print-build-logs |
0 commit comments