File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Nix Build Verification
22
3+ concurrency :
4+ group : nix-build-${{ github.ref }}
5+ cancel-in-progress : true
6+
37on :
48 pull_request :
59 branches :
610 - main
711 paths :
812 - ' nix/**'
9- - ' go.mod'
10- - ' go.sum'
11- - ' **.go'
1213 - ' .github/workflows/nix-build.yml'
1314 push :
1415 branches :
1516 - main
1617 paths :
1718 - ' nix/**'
18- - ' go.mod'
19- - ' go.sum'
20- - ' **.go'
2119 - ' .github/workflows/nix-build.yml'
2220 workflow_dispatch :
2321
5048 experimental-features = nix-command flakes
5149 accept-flake-config = true
5250
51+ - name : Set up Magic Nix Cache
52+ uses : DeterminateSystems/magic-nix-cache-action@v13
53+
5354 - name : Build with Nix
5455 run : |
5556 nix-build nix/default.nix --show-trace
8788 extra_nix_config : |
8889 experimental-features = nix-command flakes
8990
91+ - name : Set up Magic Nix Cache
92+ uses : DeterminateSystems/magic-nix-cache-action@v13
93+
9094 - name : Check Nix formatting (nixfmt-rfc-style)
9195 run : |
9296 nix-shell -p nixfmt-rfc-style --run "nixfmt --check nix/package.nix nix/default.nix"
Original file line number Diff line number Diff line change 3434 extra_nix_config : |
3535 experimental-features = nix-command flakes
3636
37+ - name : Set up Magic Nix Cache
38+ uses : DeterminateSystems/magic-nix-cache-action@v13
39+
3740 - name : Determine version
3841 id : version
3942 run : |
9699 sed -i "s|vendorHash = \"[^\"]*\";|vendorHash = \"sha256-$VENDOR_HASH\";|" nix/package.nix
97100 echo "Updated vendorHash in nix/package.nix"
98101
99- - name : Verify build
100- run : |
101- echo "Building with updated hashes to verify..."
102- nix-build nix/default.nix --show-trace
103-
104- echo "Verifying binary..."
105- result/bin/infer version
106-
107102 - name : Format Nix file
108103 run : |
109104 nix-shell -p nixfmt-rfc-style --run "nixfmt nix/package.nix"
@@ -123,9 +118,11 @@ jobs:
123118 - ✅ Updated `version` to `${{ steps.version.outputs.version }}`
124119 - ✅ Updated source `hash` to `sha256-${{ steps.source-hash.outputs.hash }}`
125120 - ✅ Updated `vendorHash` to `sha256-${{ steps.vendor-hash.outputs.hash }}`
126- - ✅ Verified build succeeds
127121 - ✅ Formatted with nixfmt-rfc-style
128122
123+ The `Nix Build Verification` workflow runs on this PR and is the
124+ authoritative gate for verifying the updated hashes build cleanly.
125+
129126 ### Verification
130127 ```bash
131128 nix-build nix/default.nix
You can’t perform that action at this time.
0 commit comments