File tree Expand file tree Collapse file tree 2 files changed +42
-10
lines changed Expand file tree Collapse file tree 2 files changed +42
-10
lines changed Original file line number Diff line number Diff line change 77 pull_request :
88
99jobs :
10- build-server :
11- name : Build with Nix
10+ decision :
11+ name : Decide what we need to build
1212 runs-on : ubuntu-latest
13+
14+ outputs :
15+ packages : ${{ steps.packages.outputs.packages }}
16+
17+ steps :
18+ - name : Packages
19+ id : packages
20+ run : |
21+ packages=$(nix eval .#packages.x86_64-linux --apply builtins.attrNames --json)
22+ echo "PACKAGES -> $packages"
23+ echo "::set-output name=packages::$packages"
24+
25+ build :
26+ name : Build ${{ matrix.packages }}
27+ needs :
28+ - decision
29+ runs-on : ubuntu-latest
30+
31+ strategy :
32+ fail-fast : false
33+ matrix :
34+ package : ${{ fromJSON(needs.decision.outputs.packages) }}
35+ exclude :
36+ - package : default
37+
1338 steps :
1439
1540 - name : Checkout
@@ -20,11 +45,17 @@ jobs:
2045 with :
2146 CACHIX_AUTH_TOKEN : ${{ secrets.CACHIX_AUTH_TOKEN }}
2247
23- - name : Flake check
24- run : nix flake check
25-
26- - name : Build catalyst-toolbox
27- run : nix build -L .#catalyst-toolbox
28-
29- - name : Build snapshot-lib
30- run : nix build -L .#snapshot-lib
48+ - name : Build ${{ matrix.package }} package
49+ run : |
50+ path=$(nix eval --raw .#packages.x86_64-linux.${{ matrix.package }})
51+ hash=${path:11:32}
52+ url="https://iog.cachix.org/$hash.narinfo";
53+ if curl --output /dev/null --silent --head --fail "$url"; then
54+ echo "Nothing to build!!!"
55+ echo ""
56+ echo "See build log with:"
57+ echo " nix log $path"
58+ echo ""
59+ else
60+ nix build .#packages.x86_64-linux.${{ matrix.package }} --show-trace -L
61+ fi
Original file line number Diff line number Diff line change 137137 packages =
138138 workspace
139139 // {
140+ inherit pre-commit ;
140141 default = workspace . catalyst-toolbox ;
141142 } ;
142143
You can’t perform that action at this time.
0 commit comments