File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
22name : Prepare Nix
33description : " Common setup for all runs using Nix."
4+ inputs :
5+ nativelink_attic_token :
6+ required : true
47runs :
58 using : " composite"
69 steps :
@@ -13,13 +16,13 @@ runs:
1316 with :
1417 source-tag : v3.13.0
1518
16- # FIXME(palfrey): Replace with better cache. Workers are currently taking minutes to upload data
17- # all the time, probably because we're at ~500GB of 10GB in the cache storage and it's breaking.
18- # We've tried Flakehub, but it doesn't work for us because it assumes "branches on an org repo"
19- # not our "fork and branch on your own repo" setup for it's auth so we can 't currently use that.
20-
21- # - name: Add Nix magic cache
22- # uses: >- # https://github.com/DeterminateSystems/magic-nix-cache-action/releases/tag/v13
23- # DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39
24- # with :
25- # source-tag: v0.1.6
19+ - name : Setup attic cache
20+ run : |
21+ nix build nixpkgs#attic-client
22+ # Note NATIVELINK_ATTIC_TOKEN is blank for PR builds as they don 't have secret access
23+ ./result/bin/attic login uc1-dev https://attic.uc1.scdev.nativelink.net/ $NATIVELINK_ATTIC_TOKEN
24+ ./result/bin/attic use nativelink
25+ ./result/bin/attic watch-store nativelink &
26+ shell : bash
27+ env :
28+ NATIVELINK_ATTIC_TOKEN : ${{ inputs.nativelink_attic_token }}
Original file line number Diff line number Diff line change 3131
3232 - name : Prepare Worker
3333 uses : ./.github/actions/prepare-nix
34+ with :
35+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
3436
3537 # Ubuntu 24.04 restricts unprivileged user namespaces by default, which breaks
3638 # the worker tests that use namespaces (e.g. for sandboxing).
Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ jobs:
107107
108108 - name : Prepare Worker
109109 uses : ./.github/actions/prepare-nix
110+ with :
111+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
110112
111113 - name : Upload image
112114 id : upload
Original file line number Diff line number Diff line change 3737
3838 - name : Prepare Worker
3939 uses : ./.github/actions/prepare-nix
40+ with :
41+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
4042
4143 - name : Test image
4244 run : |
Original file line number Diff line number Diff line change 3939
4040 - name : Prepare Worker
4141 uses : ./.github/actions/prepare-nix
42+ with :
43+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
4244
4345 - name : Build example with ${{ matrix.toolchain }} toolchain
4446 env :
6567
6668# - name: Prepare Worker
6769# uses: ./.github/actions/prepare-nix
70+ # with:
71+ # nativelink_attic_token: ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
6872
6973# - name: Start Kubernetes cluster
7074# run: >
Original file line number Diff line number Diff line change 3535
3636 - name : Prepare Worker
3737 uses : ./.github/actions/prepare-nix
38+ with :
39+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
3840
3941 - name : Invoke Bazel build in Nix shell
4042 run : |
6567
6668 - name : Prepare Worker
6769 uses : ./.github/actions/prepare-nix
70+ with :
71+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
6872
6973 - name : Invoke Cargo build in Nix shell
7074 run : >
8892
8993 - name : Prepare Worker
9094 uses : ./.github/actions/prepare-nix
95+ with :
96+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
9197
9298 - name : Test nix run
9399 run : |
@@ -107,6 +113,8 @@ jobs:
107113
108114 - name : Prepare Worker
109115 uses : ./.github/actions/prepare-nix
116+ with :
117+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
110118
111119 - name : Test ${{ matrix.test-name }} run
112120 run : |
Original file line number Diff line number Diff line change 2525
2626 - name : Prepare Worker
2727 uses : ./.github/actions/prepare-nix
28+ with :
29+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
2830
2931 - name : Run pre-commit hooks
3032 run : nix flake check
Original file line number Diff line number Diff line change 2929
3030 - name : Prepare Worker
3131 uses : ./.github/actions/prepare-nix
32+ with :
33+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
3234
3335 - name : Test image
3436 run : |
Original file line number Diff line number Diff line change 4545
4646 - name : Prepare Worker
4747 uses : ./.github/actions/prepare-nix
48+ with :
49+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
4850
4951 - name : Test Build
5052 if : github.event_name == 'pull_request'
Original file line number Diff line number Diff line change 525525 pkgs . lre . lre-cc . lre-cc-configs-gen
526526 pkgs . nativelink-tools . local-image-test
527527 pkgs . nativelink-tools . create-local-image
528+ pkgs . attic-client
528529 ]
529530 ++ pkgs . lib . optionals pkgs . stdenv . isDarwin [
530531 pkgs . apple-sdk_14
You can’t perform that action at this time.
0 commit comments