Skip to content

Commit

Permalink
Always try to upload artifacts even if Nova jobs fail (#5208)
Browse files Browse the repository at this point in the history
This is reported by @wconstab that Nova jobs didn't upload artifacts to
GitHub when the test script failed, so it's not possible to access them,
for example, to debug the failure. It makes sense to always try to
upload the artifacts instead:

* If the script fails, but there are artifacts, we should upload them
* If the script fails, and there is no artifact, it doesn't matter if
the upload step fails or not because the job is going to fail anyway
  • Loading branch information
huydhn authored May 15, 2024
1 parent 2698cb3 commit 8f7a4bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/linux_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ jobs:
ALPINE_IMAGE: ${{ inputs.runner == 'linux.arm64.2xlarge' && 'arm64v8/alpine' || '308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine' }}

- name: Prepare artifacts for upload
if: always()
working-directory: ${{ inputs.repository || github.repository }}
id: check-artifacts
env:
Expand Down Expand Up @@ -290,7 +291,7 @@ jobs:
- name: Upload artifacts to GitHub (if any)
uses: actions/upload-artifact@v3
if: ${{ inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' }}
with:
name: ${{ inputs.upload-artifact }}
path: ${{ runner.temp }}/artifacts/
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/macos_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
shell: bash -l {0}
working-directory: ${{ inputs.repository || github.repository }}
id: check-artifacts
if: ${{ inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' }}
env:
UPLOAD_ARTIFACT_NAME: ${{ inputs.upload-artifact }}
run: |
Expand All @@ -185,11 +185,12 @@ jobs:
- name: Upload artifacts to GitHub (if any)
uses: actions/upload-artifact@v3
if: ${{ inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' }}
with:
name: ${{ inputs.upload-artifact }}
path: ${{ runner.temp }}/artifacts/
if-no-files-found: ${{ steps.check-artifacts.outputs.if-no-files-found }}

- name: Clean up disk space
if: always()
continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
shell: bash -l {0}
working-directory: ${{ inputs.repository || github.repository }}
id: check-artifacts
if: ${{ inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' }}
env:
UPLOAD_ARTIFACT_NAME: ${{ inputs.upload-artifact }}
run: |
Expand All @@ -187,7 +187,7 @@ jobs:
- name: Upload artifacts to GitHub (if any)
uses: actions/upload-artifact@v3
if: ${{ inputs.upload-artifact != '' }}
if: ${{ always() && inputs.upload-artifact != '' }}
with:
name: ${{ inputs.upload-artifact }}
path: ${{ runner.temp }}/artifacts/
Expand Down

0 comments on commit 8f7a4bd

Please sign in to comment.