Skip to content

Commit b730f1b

Browse files
authored
Merge pull request #365 from pillo79/ci-fix2
ci/package_core: cleanup test results only on positive result
2 parents 8e15694 + 00e381b commit b730f1b

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

.github/workflows/leave_pr_comment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ jobs:
3232
- name: Check PR number
3333
id: check-pr
3434
uses: carpentries/actions/check-valid-pr@2e20fd5ee53b691e27455ce7ca3b16ea885140e8 # v0.15.0
35+
if: ${{ env.PR_NUM }}
3536
with:
3637
pr: ${{ env.PR_NUM }}
3738
sha: ${{ github.event.workflow_run.head_sha }}
3839

3940
- name: Validate PR number
40-
if: ${{ steps.check-pr.outputs.VALID != 'true' }}
41+
if: ${{ env.PR_NUM && steps.check-pr.outputs.VALID != 'true' }}
4142
run: |
42-
echo "::error::PR number $PR_NUM validation failed"
43-
exit 1
43+
echo "::warning::PR #$PR_NUM is either invalid or includes changes to workflow"
4444
4545
- name: Update PR comment
46-
if: ${{ steps.check-pr.outputs.VALID == 'true' }}
46+
if: ${{ env.PR_NUM && steps.check-pr.outputs.VALID == 'true' }}
4747
env:
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949
GH_REPO: ${{ github.repository }}

.github/workflows/package_core.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,27 @@ jobs:
435435
path: comment-request/
436436
retention-days: 1
437437

438-
# teports are no longer needed now
438+
# The last line makes the job fail if the 'result' file does not contain "PASSED".
439+
# No further actions are allowed in case of error.
440+
- run: |
441+
cat result
442+
grep -q "PASSED" result # otherwise CI test failed
443+
444+
445+
446+
# Clean up test results only if the verification actually passed, so that
447+
# they are still available for action re-runs in case of failure.
448+
449+
clean-temps:
450+
name: Clean up test results
451+
runs-on: ubuntu-latest
452+
if: ${{ needs.verify-core.result == 'success' }}
453+
needs:
454+
- build-env
455+
- package-core
456+
- verify-core
457+
steps:
458+
439459
- name: Clean up intermediate artifacts
440460
uses: geekyeggo/delete-artifact@v5.1.0
441461
with:
@@ -444,12 +464,6 @@ jobs:
444464
test-report-*
445465
failOnError: false
446466

447-
# The last line makes the job fail if the 'result' file does not contain "PASSED".
448-
# No further actions are allowed in case of error.
449-
- run: |
450-
cat result
451-
grep "PASSED" result >& /dev/null # otherwise CI test failed
452-
453467

454468

455469
# Upload the built core packages to the S3 bucket for public distribution.

0 commit comments

Comments
 (0)