diff options
| author | seth <[email protected]> | 2023-12-22 00:14:28 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-22 00:14:28 +0000 |
| commit | 8695d9d41441da0326d0260bae2f4962f32bfea0 (patch) | |
| tree | e9ff3d979c6bcfa96a944e7797a1053b8b505235 /.github/workflows | |
| parent | 648620fcae21a93a86275fc87a28732f91737725 (diff) | |
actions: try to fix subflake eval (#5)
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ci.yaml | 106 | ||||
| -rw-r--r-- | .github/workflows/example.yaml | 35 |
2 files changed, 60 insertions, 81 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 }} diff --git a/.github/workflows/example.yaml b/.github/workflows/example.yaml index 5c376c1..0c214e9 100644 --- a/.github/workflows/example.yaml +++ b/.github/workflows/example.yaml @@ -5,6 +5,7 @@ on: jobs: eval: + name: Evaluate flake runs-on: ubuntu-latest outputs: @@ -13,13 +14,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: install nix - uses: nixbuild/nix-quick-install-action@v26 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v9 - - name: generate matrix + - name: Generate matrix id: generate run: | - set -Eeu + set -eu + echo "matrix=$(nix eval --show-trace --json .#githubWorkflow.matrix)" >> "$GITHUB_OUTPUT" build: @@ -28,28 +30,27 @@ jobs: strategy: matrix: ${{ fromJSON(needs.eval.outputs.matrix) }} + name: Build (${{matrix.attr}}) runs-on: ${{ matrix.os }} - name: build (${{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 }} - run: nix build -L --fallback .#${{ matrix.attr }} + - name: Build ${{ matrix.attr }} + run: nix build -L .#${{ matrix.attr }} |
