summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-22 00:14:28 +0000
committerGitHub <[email protected]>2023-12-22 00:14:28 +0000
commit8695d9d41441da0326d0260bae2f4962f32bfea0 (patch)
treee9ff3d979c6bcfa96a944e7797a1053b8b505235 /.github/workflows/ci.yaml
parent648620fcae21a93a86275fc87a28732f91737725 (diff)
actions: try to fix subflake eval (#5)
Diffstat (limited to '.github/workflows/ci.yaml')
-rw-r--r--.github/workflows/ci.yaml106
1 files changed, 42 insertions, 64 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 0e1e598..7468b02 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -8,115 +8,93 @@ on:
jobs:
eval:
- strategy:
- matrix:
- test: [lib, module]
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
- - uses: nixbuild/nix-quick-install-action@v26
-
- - name: generate matrix
- run: |
- set -euxo pipefail
-
- cd test/${{ matrix.test }}
- nix eval --show-trace --json .#githubWorkflow.matrix > matrix-${{ matrix.test }}.json
-
- - name: store matrix
- uses: actions/upload-artifact@v3
- with:
- name: matrix-${{ matrix.test }}
- path: test/${{ matrix.test }}/matrix-${{ matrix.test }}.json
-
- read:
- needs: eval
+ name: Evaluate flake
runs-on: ubuntu-latest
outputs:
- lib-matrix: ${{ steps.module.outputs.result }}
- module-matrix: ${{ steps.lib.outputs.result }}
+ lib-matrix: ${{ steps.generate.outputs.lib }}
+ module-matrix: ${{ steps.generate.outputs.module }}
steps:
- - uses: actions/download-artifact@v3
+ - uses: actions/checkout@v4
+
+ - name: Install Nix
+ uses: DeterminateSystems/nix-installer-action@v9
- - name: recover lib matrix
- id: lib
- run:
- echo "result=$(cat matrix-lib/matrix-lib.json)" >> "$GITHUB_OUTPUT"
+ - name: Generate matrix
+ id: generate
+ run: |
+ set -eu
- - name: recover module matrix
- id: module
- run:
- echo "result=$(cat matrix-module/matrix-module.json)" >> "$GITHUB_OUTPUT"
+ for dir in "lib" "module"; do
+ pushd test/"$dir"
+ echo "$dir=$(nix eval --show-trace --json .#githubWorkflow.matrix)" >> "$GITHUB_OUTPUT"
+ popd
+ done
# would be nice to have another matrix for these but meh
test-lib:
- needs: read
+ needs: eval
strategy:
- matrix: ${{ fromJSON(needs.read.outputs.lib-matrix) }}
+ matrix: ${{ fromJSON(needs.eval.outputs.lib-matrix) }}
+ name: Build (lib/${{ matrix.attr }})
runs-on: ${{ matrix.os }}
- name: build (lib/${{ matrix.attr }})
-
steps:
- uses: actions/checkout@v4
- - name: setup qemu
+ - name: Setup Qemu
if: matrix.arch == 'aarch64'
- run: |
- sudo apt update -y
- sudo apt install -y qemu-user-static
+ uses: docker/setup-qemu-action@v3
+ with:
+ platforms: "arm64"
- - name: install nix
+ - name: Install Nix
if: matrix.arch != 'aarch64'
- uses: nixbuild/nix-quick-install-action@v26
+ uses: DeterminateSystems/nix-installer-action@v9
- - name: install nix (with aarch64)
+ - name: Install Nix (with aarch64)
if: matrix.arch == 'aarch64'
- uses: nixbuild/nix-quick-install-action@v26
+ uses: DeterminateSystems/nix-installer-action@v9
with:
- nix_conf: "extra-platforms = aarch64-linux arm-linux"
+ extra-conf: "extra-platforms = aarch64-linux arm-linux"
- - name: build ${{ matrix.attr }}
+ - name: Build ${{ matrix.attr }}
run: |
cd test/lib
nix build -L .#${{ matrix.attr }}
test-module:
- needs: read
+ needs: eval
strategy:
- matrix: ${{ fromJSON(needs.read.outputs.module-matrix) }}
+ matrix: ${{ fromJSON(needs.eval.outputs.module-matrix) }}
+ name: Build (module/${{ matrix.attr }})
runs-on: ${{ matrix.os }}
- name: build (module/${{ matrix.attr }})
-
steps:
- uses: actions/checkout@v4
- - name: setup qemu
+ - name: Setup Qemu
if: matrix.arch == 'aarch64'
- run: |
- sudo apt update -y
- sudo apt install -y qemu-user-static
+ uses: docker/setup-qemu-action@v3
+ with:
+ platforms: "arm64"
- - name: install nix
+ - name: Install Nix
if: matrix.arch != 'aarch64'
- uses: nixbuild/nix-quick-install-action@v26
+ uses: DeterminateSystems/nix-installer-action@v9
- - name: install nix (with aarch64)
+ - name: Install Nix (with aarch64)
if: matrix.arch == 'aarch64'
- uses: nixbuild/nix-quick-install-action@v26
+ uses: DeterminateSystems/nix-installer-action@v9
with:
- nix_conf: "extra-platforms = aarch64-linux arm-linux"
+ extra-conf: "extra-platforms = aarch64-linux arm-linux"
- - name: build ${{ matrix.attr }}
+ - name: Build ${{ matrix.attr }}
run: |
cd test/module
nix build -L .#${{ matrix.attr }}