ci: nested matrix build

This commit is contained in:
Matt Sturgeon 2025-05-25 23:20:50 +01:00
parent ce432ab608
commit ed2c309964
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 79 additions and 36 deletions

View file

@ -6,13 +6,8 @@ on:
name:
required: true
type: string
system:
required: true
type: string
os:
required: true
type: string
attr:
builds:
description: "json array of builds: [ { system, runner, attr } ]"
required: true
type: string
timeout:
@ -22,13 +17,16 @@ on:
jobs:
build:
name: ${{ inputs.name }}
name: ${{ inputs.name }} (${{ matrix.attr }})
runs-on:
- ${{ inputs.os }}
- ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(inputs.builds) }}
timeout-minutes: ${{ inputs.timeout }}
steps:
- name: Free disk space
if: endsWith( '-linux', inputs.system )
if: endsWith( '-linux', matrix.system )
uses: wimpysworld/nothing-but-nix@main
with:
# Options: holster, carve, cleave (default), rampage
@ -42,9 +40,9 @@ jobs:
with:
name: nix-community
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build ${{ inputs.attr }}
- name: Build ${{ matrix.attr }}
env:
attr: ${{ inputs.attr }}
attr: ${{ matrix.attr }}
run: |
nix build ".#$attr" \
--abort-on-warn \

View file

@ -39,7 +39,5 @@ jobs:
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
secrets: inherit
with:
name: ${{ matrix.name }} (${{ matrix.system }})
system: ${{ matrix.system }}
os: ${{ join( matrix.os, ' ' ) }} # FIXME: os is an array!
attr: ${{ matrix.attr }}
name: ${{ matrix.name }}
builds: ${{ toJSON(matrix.builds) }}