Skip to content

Commit

Permalink
Remove artifacts even if a previous job is failed
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy-chernysh committed Oct 9, 2024
1 parent 2d5cc3e commit 93636ed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clean-up-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
name: |
bundles
release_notes
google_service
google_service_json
failOnError: false

2 changes: 1 addition & 1 deletion .github/workflows/create-service-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
- name: Upload to artifacts
uses: actions/upload-artifact@v4
with:
name: google_service
name: google_service_json
path: ${{ github.workspace }}/app/google-services.json

10 changes: 10 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
jobs:
run-tests:
runs-on: ubuntu-latest
# Setting up ENV for all steps in this job
env:
DOWNLOADS_PATH: ./downloaded-artifacts

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
Expand Down Expand Up @@ -40,6 +44,12 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Download Google Service JSON for GitHub artifacs
uses: actions/download-artifact@v4
with:
name: google_service_json
path: ${{ env.DOWNLOADS_PATH }}

- name: Update dependencies
run: ./gradlew dependencies

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ jobs:
remove-artifacts:
uses: ./.github/workflows/clean-up-artifacts.yml
needs: run-tests
# Run this job even if "needs" job is failed
if: ${{ always() && contains(needs.*.result, 'failure') }}
secrets: inherit

0 comments on commit 93636ed

Please sign in to comment.