Skip to content

Commit 4bb004e

Browse files
authored
Merge pull request #93 from trinitronx/fix-ci-status
ci: Consolidate matrix job status into single job for branch protection usage
2 parents fbcabaa + c34ef47 commit 4bb004e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,18 @@ jobs:
6464
export TERM=xterm-color
6565
log show --color always --last 5m
6666
KITCHEN_LOCAL_YAML=${{ matrix.KITCHEN_LOCAL_YAML }} kitchen exec ${{ matrix.suite }}-${{ matrix.os }} -c "syslog"
67+
68+
integration_result:
69+
needs: [integration]
70+
if: always()
71+
runs-on: [ubuntu-latest]
72+
steps:
73+
- name: check the jobs # get the matrix job status and combination info
74+
run: |
75+
job_status=$(curl -X GET -s --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq ".jobs[] | {job_status: .conclusion, matrix: .name}")
76+
echo echo ::set-env JOB_STATUS=$job_status
77+
- name: Set matrix job status
78+
if: contains(env.JOB_STATUS, 'failed')
79+
run: |
80+
echo 'One or more integration matrix jobs failed!'
81+
exit 1

0 commit comments

Comments
 (0)