File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed
Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 1414
1515jobs :
1616 tests :
17+ name : Tests (${{ matrix.ruby }})
18+ permissions :
19+ pull-requests : write
1720 runs-on : ubuntu-latest
18- name : Tests
21+ continue-on-error : ${{ matrix.optional }}
1922 strategy :
2023 fail-fast : false
2124 matrix :
2225 ruby :
2326 - " 3.4"
2427 - " 3.3"
2528 - " 3.2"
29+ optional : [false]
2630 include :
2731 - ruby : " 3.4"
2832 coverage : " true"
33+ - ruby : " jruby"
34+ optional : true
2935 env :
3036 COVERAGE : ${{matrix.coverage}}
3137 steps :
3945 ruby-version : ${{matrix.ruby}}
4046 bundler-cache : true
4147 - name : Run all tests
42- run : bundle exec rake
48+ id : test
49+ run : |
50+ status=0
51+ bundle exec rake || status=$?
52+ if [ ${status} -ne 0 ] && [ "${{ matrix.optional }}" == "true" ]; then
53+ echo "::warning::Optional matrix job failed."
54+ echo "optional_fail=true" >> "${GITHUB_OUTPUT}"
55+ echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}"
56+ exit 0 # Ignore error here to keep the green checkmark
57+ fi
58+ exit ${status}
59+ - name : Add comment for optional failures
60+ uses : thollander/actions-comment-pull-request@v3
61+ if : ${{ matrix.optional && github.event.pull_request }}
62+ with :
63+ comment-tag : " ${{ matrix.ruby }}-optional-failure-notice"
64+ message : |
65+ ℹ️ Optional job failed: Ruby ${{ matrix.ruby }}
66+ mode : ${{ steps.test.outputs.optional_fail == 'true' && 'upsert' || 'delete' }}
67+
4368 workflow-keepalive :
4469 if : github.event_name == 'schedule'
4570 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments