Skip to content

Commit

Permalink
Merge branch 'main' into willdavsmith/fork-functional-test-4
Browse files Browse the repository at this point in the history
  • Loading branch information
willdavsmith authored Mar 11, 2024
2 parents f6e3a27 + b4a4899 commit 9262220
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/functional-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -655,22 +655,22 @@ jobs:
- name: Get tests job status
id: get_test_status
run: |
TEST_STATUS=failure # default to failure
# from: https://github.com/orgs/community/discussions/26526#discussioncomment-3252209
jobstatus=$(curl -X GET -s -u "admin:${{ steps.get_installation_token.outputs.token }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq ".jobs[] | {job_status: .conclusion, matrix: .name}")
# if jobstatus contains failure
if echo "$jobstatus" | grep -q "failure"; then
JOB_STATUS=$(curl -X GET -s -u "admin:${{ steps.get_installation_token.outputs.token }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq ".jobs[] | {job_status: .conclusion, matrix: .name}")
if [[ $JOB_STATUS == *"failure"* ]]; then
echo "Found failed test. Setting test status to failure"
TEST_STATUS=failure
elif echo "$jobstatus" | grep -q "cancelled"; then
elif [[ $JOB_STATUS == *"cancelled"* ]]; then
echo "Found cancelled test. Setting test status to cancelled"
TEST_STATUS=cancelled
else
# if no failures, then it's a success
echo "No failed or cancelled tests found. Setting test status to success"
TEST_STATUS=success
fi
echo "Test Status: $jobstatus"
echo "Job Status: $JOB_STATUS"
echo "Test Status: $TEST_STATUS"
echo "test_status=$TEST_STATUS" >> $GITHUB_ENV
echo "test_status=$TEST_STATUS" >> $GITHUB_OUTPUT
- uses: LouisBrunner/checks-action@v1.6.1
if: always()
with:
Expand Down

0 comments on commit 9262220

Please sign in to comment.