Skip to content

Commit 63bb1a7

Browse files
committed
Add GitHub action
1 parent e473af5 commit 63bb1a7

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Build"
2+
on:
3+
push:
4+
pull_request:
5+
jobs:
6+
packages:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
10+
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
11+
with:
12+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
13+
- name: Get packages from flake
14+
id: packages
15+
run: |
16+
echo -n "packages=" >> "$GITHUB_OUTPUT"
17+
nix flake show --json | \
18+
jq -c ".packages.\"x86_64-linux\" | keys" >> "$GITHUB_OUTPUT"
19+
outputs:
20+
packages: ${{steps.packages.outputs.packages}}
21+
build:
22+
runs-on: ubuntu-latest
23+
needs:
24+
- packages
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
package: ${{ fromJSON(needs.packages.outputs.packages) }}
29+
steps:
30+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
31+
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
32+
with:
33+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
34+
- uses: DeterminateSystems/magic-nix-cache-action@908b263ff629f4cc17666315b7fd3ec127c6244d # v14
35+
with:
36+
diagnostic-endpoint: ""
37+
- run: nix build -L .#${{ matrix.package }}
38+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
39+
with:
40+
name: ${{ matrix.package }}
41+
path: result

0 commit comments

Comments
 (0)