forked from rvolosatovs/nixify
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.84 KB
/
build.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
70
71
72
73
74
75
76
77
78
79
80
81
name: build
on:
workflow_dispatch:
pull_request:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust-hello:
strategy:
matrix:
config:
# Linux
- os: ubuntu-22.04
package: default
test-bin: ./result/bin/rust-hello
- os: ubuntu-22.04
package: rust-hello
test-bin: ./result/bin/rust-hello
- os: ubuntu-22.04
package: rust-hello-aarch64-unknown-linux-musl
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-wasm32-wasi
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-x86_64-unknown-linux-musl
test-bin: ./result/bin/rust-hello
test-oci: |
docker load < ./result
docker run --rm rust-hello:$(nix eval --raw --override-input 'nixify' '.' ./examples/rust-hello#rust-hello-x86_64-unknown-linux-musl-oci.imageTag)
- os: ubuntu-22.04
package: rust-hello-debug
test-bin: ./result/bin/rust-hello
- os: ubuntu-22.04
package: rust-hello-debug-aarch64-unknown-linux-musl
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-wasm32-wasi
test-bin: nix run --inputs-from . 'nixpkgs#wasmtime' ./result/bin/rust-hello
test-oci: docker load < ./result
- os: ubuntu-22.04
package: rust-hello-debug-x86_64-unknown-linux-musl
test-bin: ./result/bin/rust-hello
test-oci: |
docker load < ./result
docker run --rm rust-hello:$(nix eval --raw --override-input 'nixify' '.' ./examples/rust-hello#rust-hello-x86_64-unknown-linux-musl-oci.imageTag)
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v12
with:
name: enarx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L --show-trace --override-input 'nixify' '.' './examples/rust-hello#${{ matrix.config.package }}'
- run: ${{ matrix.config.test }}
- run: nix build -L --show-trace --override-input 'nixify' '.' './examples/rust-hello#${{ matrix.config.package }}-oci'
if: ${{ matrix.config.package != 'default' && matrix.config.package != 'rust-hello' && matrix.config.package != 'rust-hello-debug' }}
- run: ${{ matrix.config.test-oci }}