Skip to content

Commit

Permalink
ci(ld): dynamic targets matrix
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jul 11, 2023
1 parent 7fa9dc1 commit 72d0da8
Showing 1 changed file with 46 additions and 25 deletions.
71 changes: 46 additions & 25 deletions .github/workflows/ld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,34 @@ jobs:
./docker-bake.hcl
targets: ld64-tgz

binutils-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create targets matrix
id: targets
run: |
matrix=$(docker buildx bake binutils --print | jq -cr '.group.binutils.targets')
echo "matrix=${matrix}" >> ${GITHUB_OUTPUT}
-
name: Show matrix
run: |
echo ${{ steps.targets.outputs.matrix }}
binutils:
runs-on: ubuntu-latest
needs:
- binutils-targets
continue-on-error: ${{ matrix.allow-failure }}
strategy:
fail-fast: false
matrix:
include:
- target: linux-arm64
- target: linux-amd64
- target: linux-armv7
- target: linux-armv6
- target: linux-ppc64le
- target: linux-386
- target: linux-riscv64
- target: linux-s390x
- target: windows-amd64
- target: windows-386
target: ${{ fromJson(needs.binutils-targets.outputs.matrix) }}
steps:
-
name: Checkout
Expand All @@ -69,26 +80,36 @@ jobs:
name: Build
uses: docker/bake-action@v2
with:
targets: binutils-${{ matrix.target }}-alpine
targets: ${{ matrix.target }}

ld-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create targets matrix
id: targets
run: |
matrix=$(docker buildx bake ld-static-tgz --print | jq -cr '.group."ld-static-tgz".targets')
echo "matrix=${matrix}" >> ${GITHUB_OUTPUT}
-
name: Show matrix
run: |
echo ${{ steps.targets.outputs.matrix }}
ld:
runs-on: ubuntu-latest
needs:
- ld-targets
continue-on-error: ${{ matrix.allow-failure }}
strategy:
fail-fast: false
matrix:
include:
- target: linux-arm64
- target: linux-amd64
- target: linux-armv7
- target: linux-armv6
- target: linux-ppc64le
- target: linux-386
- target: linux-riscv64
- target: linux-s390x
- target: windows-amd64
- target: windows-386

target: ${{ fromJson(needs.ld-targets.outputs.matrix) }}
steps:
-
name: Checkout
Expand All @@ -103,4 +124,4 @@ jobs:
name: Build
uses: docker/bake-action@v2
with:
targets: ld-${{ matrix.target }}-tgz
targets: ${{ matrix.target }}

0 comments on commit 72d0da8

Please sign in to comment.