Skip to content

Commit

Permalink
fix matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mauwii committed Oct 12, 2023
1 parent 14410a2 commit 877fca4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ jobs:
- name: Generate targets matrix
id: targets
run: |
printf "matrix=%s\n" "$(docker buildx bake --print | jq -r '"\(.target | keys)"')" | tee "${GITHUB_OUTPUT}"
printf "matrix={\"targets\": %s}\n" "$(docker buildx bake --print | jq -r '"\(.target | keys)"')" | tee "${GITHUB_OUTPUT}"
- name: Generate platforms matrix
id: platforms
run: |
printf "matrix=%s\n" "$(docker buildx bake linux-platforms --print | jq -cr '.target."linux-platforms".platforms')" | tee "${GITHUB_OUTPUT}"
printf "matrix={\"targets\": %s, \"platforms\": %s}\n" "$(docker buildx bake --print | jq -r '"\(.target | keys)"')" "$(docker buildx bake linux-platforms --print | jq -cr '.target."linux-platforms".platforms')" | tee "${GITHUB_OUTPUT}"
build:
needs: [generate-jobs]
Expand All @@ -91,10 +91,8 @@ jobs:
pull-requests: write
security-events: write
strategy:
fail-fast: ${{ fromJson(format('{0}', github.event_name != 'pull_request')) }}
matrix:
targets: ${{ fromJson(needs.generate-jobs.outputs.targets) }}
platforms: ${{ github.event_name == 'pull_request' && fromJson(needs.generate-jobs.outputs.platforms) || '[]' }}
fail-fast: ${{ github.event_name != 'pull_request' }}
matrix: ${{ github.event_name != 'pull_request' && fromJson(needs.generate-jobs.outputs.targets) || fromJson(needs.generate-jobs.outputs.platforms) }}
steps:
- name: Checkout code
uses: actions/[email protected]
Expand Down

0 comments on commit 877fca4

Please sign in to comment.