Skip to content

Commit

Permalink
ci: Fix test-success job condition (#22853)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov authored Jun 18, 2023
1 parent 6ac3292 commit 66b82ac
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,22 +375,30 @@ jobs:
timeout-minutes: 1
if: always()
steps:
- if: |
- name: Fail for failed or cancelled tests
if: |
needs.test.result == 'failure' ||
needs.test.result == 'cancelled' ||
(needs.test.result == 'skipped' &&
!(github.event.pull_request.draft &&
needs.setup.outputs.test-matrix-empty == 'true')
)
needs.test.result == 'cancelled'
run: exit 1

- if: |
- name: Fail for skipped tests when PR is ready for review
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.draft != true &&
needs.test.result == 'skipped'
run: exit 1

- name: Fail for failed or cancelled coverage
if: |
needs.coverage.result == 'failure' ||
needs.coverage.result == 'cancelled' ||
(needs.coverage.result == 'skipped' &&
!(github.event.pull_request.draft &&
needs.setup.outputs.test-matrix-empty == 'true')
)
needs.coverage.result == 'cancelled'
run: exit 1

- name: Fail for skipped coverage when PR is ready for review
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.draft != true &&
needs.coverage.result == 'skipped'
run: exit 1

build:
Expand Down

0 comments on commit 66b82ac

Please sign in to comment.