-
Notifications
You must be signed in to change notification settings - Fork 15
69 lines (58 loc) · 1.63 KB
/
nix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Nix CI
on:
push:
branches:
- main
- catalyst-fund*
pull_request:
jobs:
decision:
name: Decide what we need to build
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.packages.outputs.packages }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/nix-common-setup
with:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Packages
id: packages
run: |
packages=$(nix eval .#packages.x86_64-linux --apply builtins.attrNames --json)
echo "PACKAGES -> $packages"
echo "::set-output name=packages::$packages"
build:
name: Build ${{ matrix.package }} package
needs:
- decision
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.decision.outputs.packages) }}
exclude:
- package: default
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/nix-common-setup
with:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build package
run: |
path=$(nix eval --raw .#packages.x86_64-linux.${{ matrix.package }})
hash=${path:11:32}
url="https://iog.cachix.org/$hash.narinfo";
if curl --output /dev/null --silent --head --fail "$url"; then
echo "Nothing to build!!!"
echo ""
echo "See build log with:"
echo " nix log $path"
echo ""
else
nix build .#packages.x86_64-linux.${{ matrix.package }} --show-trace -L
fi