|
5 | 5 | workflow_dispatch:
|
6 | 6 | push:
|
7 | 7 | branches: [ "ci", "main" ]
|
8 |
| -jobs: |
9 |
| - |
10 | 8 |
|
| 9 | +jobs: |
11 | 10 |
|
12 |
| - build: |
| 11 | + nix-matrix: |
13 | 12 | runs-on: ubuntu-latest
|
14 |
| - continue-on-error: true |
| 13 | + outputs: |
| 14 | + matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - uses: cachix/install-nix-action@v30 |
| 18 | + - id: set-matrix |
| 19 | + name: Generate Nix Matrix |
| 20 | + run: | |
| 21 | + set -Eeu |
| 22 | + matrix="$(nix eval --json '.#githubActions.matrix')" |
| 23 | + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" |
| 24 | +
|
| 25 | + nix-build: |
| 26 | + name: ${{ matrix.name }} (${{ matrix.system }}) |
| 27 | + needs: nix-matrix |
| 28 | + runs-on: ${{ matrix.os }} |
15 | 29 | strategy:
|
16 |
| - fail-fast: false |
17 |
| - matrix: |
18 |
| - system: [ x86_64-linux, aarch64-linux ] |
19 |
| - |
| 30 | + matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} |
20 | 31 | steps:
|
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - uses: cachix/install-nix-action@v30 |
| 34 | + - run: nix build -L '.#${{ matrix.attr }}' |
21 | 35 |
|
22 |
| - - uses: actions/checkout@v4 |
23 |
| - with: |
24 |
| - # Nix Flakes doesn't work on shallow clones |
25 |
| - fetch-depth: 0 |
26 | 36 |
|
27 |
| - - uses: cachix/install-nix-action@V27 |
28 |
| - with: |
29 |
| - extra_nix_config: | |
30 |
| - experimental-features = nix-command flakes |
31 |
| - extra-platforms = ${{ matrix.system }} |
| 37 | + # build: |
| 38 | + # runs-on: ubuntu-latest |
| 39 | + # continue-on-error: true |
| 40 | + # strategy: |
| 41 | + # fail-fast: false |
| 42 | + # matrix: |
| 43 | + # system: [ x86_64-linux, aarch64-linux ] |
32 | 44 |
|
33 |
| - - uses: cachix/cachix-action@v14 |
34 |
| - with: |
35 |
| - name: nix-portable |
36 |
| - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
| 45 | + # steps: |
37 | 46 |
|
38 |
| - - name: Set up QEMU |
39 |
| - uses: docker/setup-qemu-action@v2 |
40 |
| - with: |
41 |
| - image: tonistiigi/binfmt@sha256:8de6f2decb92e9001d094534bf8a92880c175bd5dfb4a9d8579f26f09821cfa2 |
42 |
| - platforms: all |
| 47 | + # - uses: actions/checkout@v4 |
| 48 | + # with: |
| 49 | + # # Nix Flakes doesn't work on shallow clones |
| 50 | + # fetch-depth: 0 |
43 | 51 |
|
44 |
| - - name: Install binfmt support |
45 |
| - run: sudo apt-get install -y |
| 52 | + # - uses: cachix/install-nix-action@V27 |
| 53 | + # with: |
| 54 | + # extra_nix_config: | |
| 55 | + # experimental-features = nix-command flakes |
| 56 | + # extra-platforms = ${{ matrix.system }} |
46 | 57 |
|
47 |
| - - run: 'nix build -L .#defaultPackage.${{ matrix.system }}' |
| 58 | + # - uses: cachix/cachix-action@v14 |
| 59 | + # with: |
| 60 | + # name: nix-portable |
| 61 | + # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
48 | 62 |
|
49 |
| - - name: Archive result |
50 |
| - uses: actions/upload-artifact@v4 |
51 |
| - with: |
52 |
| - name: nix-portable-${{ matrix.system }} |
53 |
| - path: result/bin/nix-portable |
| 63 | + # - name: Set up QEMU |
| 64 | + # uses: docker/setup-qemu-action@v2 |
| 65 | + # with: |
| 66 | + # image: tonistiigi/binfmt@sha256:8de6f2decb92e9001d094534bf8a92880c175bd5dfb4a9d8579f26f09821cfa2 |
| 67 | + # platforms: all |
54 | 68 |
|
| 69 | + # - name: Install binfmt support |
| 70 | + # run: sudo apt-get install -y |
55 | 71 |
|
| 72 | + # - run: 'nix build -L .#defaultPackage.${{ matrix.system }}' |
56 | 73 |
|
| 74 | + # - name: Archive result |
| 75 | + # uses: actions/upload-artifact@v4 |
| 76 | + # with: |
| 77 | + # name: nix-portable-${{ matrix.system }} |
| 78 | + # path: result/bin/nix-portable |
57 | 79 |
|
58 |
| - test_qemu: |
59 |
| - name: Test via qemu |
60 |
| - needs: build |
61 |
| - if: true |
62 |
| - runs-on: ubuntu-latest |
63 |
| - continue-on-error: true |
64 |
| - strategy: |
65 |
| - fail-fast: false |
66 |
| - matrix: |
67 |
| - qemu_os: [ arch, centos7, debian, nixos, ubuntu_22_04, ubuntu_23_10, ubuntu_24_04, debian-aarch64 ] |
68 |
| - steps: |
| 80 | + # test_qemu_x86_64: |
| 81 | + # name: Test via qemu x86_64-linux |
| 82 | + # needs: build |
| 83 | + # if: true |
| 84 | + # runs-on: ubuntu-latest |
| 85 | + # continue-on-error: true |
| 86 | + # strategy: |
| 87 | + # fail-fast: false |
| 88 | + # matrix: |
| 89 | + # qemu_os: [ arch, centos7, debian, nixos, ubuntu_22_04, ubuntu_23_10, ubuntu_24_04 ] |
| 90 | + # steps: |
69 | 91 |
|
70 |
| - - uses: actions/checkout@v4 |
71 |
| - with: |
72 |
| - # Nix Flakes doesn't work on shallow clones |
73 |
| - fetch-depth: 0 |
| 92 | + # - uses: actions/checkout@v4 |
| 93 | + # with: |
| 94 | + # # Nix Flakes doesn't work on shallow clones |
| 95 | + # fetch-depth: 0 |
74 | 96 |
|
75 |
| - - uses: cachix/install-nix-action@V27 |
76 |
| - with: |
77 |
| - extra_nix_config: | |
78 |
| - experimental-features = nix-command flakes |
79 |
| - extra-platforms = ${{ matrix.system }} |
| 97 | + # - uses: cachix/install-nix-action@V27 |
| 98 | + # with: |
| 99 | + # extra_nix_config: | |
| 100 | + # experimental-features = nix-command flakes |
| 101 | + # extra-platforms = ${{ matrix.system }} |
80 | 102 |
|
81 |
| - - uses: cachix/cachix-action@v14 |
82 |
| - with: |
83 |
| - name: nix-portable |
84 |
| - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
| 103 | + # - uses: cachix/cachix-action@v14 |
| 104 | + # with: |
| 105 | + # name: nix-portable |
| 106 | + # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
85 | 107 |
|
86 |
| - - name: Set up QEMU |
87 |
| - uses: docker/setup-qemu-action@v2 |
88 |
| - with: |
89 |
| - image: tonistiigi/binfmt@sha256:8de6f2decb92e9001d094534bf8a92880c175bd5dfb4a9d8579f26f09821cfa2 |
90 |
| - platforms: all |
| 108 | + # - run: 'nix run -L .#job-qemu-${{ matrix.qemu_os }}' |
91 | 109 |
|
92 |
| - - name: Install binfmt support |
93 |
| - run: sudo apt-get install -y |
| 110 | + # test_qemu_aarch64: |
| 111 | + # name: Test via qemu aarch64-linux |
| 112 | + # needs: build |
| 113 | + # if: true |
| 114 | + # runs-on: ubuntu-24.04-arm |
| 115 | + # continue-on-error: true |
| 116 | + # strategy: |
| 117 | + # fail-fast: false |
| 118 | + # matrix: |
| 119 | + # qemu_os: [ debian-aarch64 ] |
| 120 | + # steps: |
| 121 | + |
| 122 | + # - uses: actions/checkout@v4 |
| 123 | + # with: |
| 124 | + # # Nix Flakes doesn't work on shallow clones |
| 125 | + # fetch-depth: 0 |
| 126 | + |
| 127 | + # - uses: cachix/install-nix-action@V27 |
| 128 | + # with: |
| 129 | + # extra_nix_config: | |
| 130 | + # experimental-features = nix-command flakes |
| 131 | + # extra-platforms = ${{ matrix.system }} |
| 132 | + |
| 133 | + # - uses: cachix/cachix-action@v14 |
| 134 | + # with: |
| 135 | + # name: nix-portable |
| 136 | + # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' |
94 | 137 |
|
95 |
| - - run: 'nix run -L .#job-qemu-${{ matrix.qemu_os }}' |
| 138 | + # - run: 'nix run -L .#job-qemu-${{ matrix.qemu_os }}' |
96 | 139 |
|
97 | 140 | # test_nix-static:
|
98 | 141 | # name: Test nix-static via qemu
|
@@ -126,7 +169,7 @@ jobs:
|
126 | 169 |
|
127 | 170 | test_github:
|
128 | 171 | name: Test inside github action
|
129 |
| - needs: build |
| 172 | + needs: nix-build |
130 | 173 | if: true
|
131 | 174 | runs-on: ubuntu-latest
|
132 | 175 | steps:
|
|
0 commit comments