Skip to content

Commit c548fb6

Browse files
committed
ci: try macOS-style cache-nix-action for the native build (explore)
1 parent 23c33fc commit c548fb6

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

‎.github/actions/build-linux-native-package/action.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
runs:
1414
using: composite
1515
steps:
16-
- uses: ./.github/actions/setup-nix
16+
- uses: ./.github/actions/setup-linux-nix-action-cache
1717

1818
- name: Build Linux static binary
1919
shell: bash
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Setup Linux Nix (action cache, macOS-style)
2+
description: >
3+
Install Nix and restore/save the store with cache-nix-action, mirroring the
4+
macOS setup. Combined with the deps profile pin, the GC keeps the rooted
5+
cargoArtifacts while trimming the (substitutable) toolchain, so the cache
6+
stays under the GitHub Actions size limit but still warms the deps.
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Install Nix
11+
uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
12+
with:
13+
github_access_token: ${{ github.token }}
14+
nix_conf: |
15+
access-tokens = github.com=${{ github.token }}
16+
17+
- name: Cache Linux Nix store
18+
uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.2
19+
with:
20+
primary-key: nix-buildnative-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.lock', 'flake.nix', 'package.nix', 'nix/**/*.nix', 'rust-toolchain.toml', 'rust/Cargo.lock') }}
21+
restore-prefixes-first-match: nix-buildnative-${{ runner.os }}-${{ runner.arch }}-
22+
gc-max-store-size-linux: 4000000000
23+
purge: true
24+
purge-prefixes: nix-buildnative-${{ runner.os }}-${{ runner.arch }}-
25+
purge-created: 172800
26+
purge-primary-key: never

0 commit comments

Comments
 (0)