Skip to content

Commit

Permalink
Only upload report if build succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Nov 18, 2023
1 parent cd469e5 commit 2d462c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
with:
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/1.') }}
- name: Build
id: build
run: |
./gradlew build
- name: Publish
Expand All @@ -33,7 +34,7 @@ jobs:
./gradlew test
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: success() || failure()
if: (success() || failure()) && steps.build.conclusion == 'success'
with:
name: junit-test-results
path: "*/build/test-results/test/TEST-*.xml"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: gradle/gradle-build-action@v2
name: Setup Gradle
- name: Build
id: build
run: |
./gradlew build
- name: Publish
Expand All @@ -34,7 +35,7 @@ jobs:
./gradlew test
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: success() || failure()
if: (success() || failure()) && steps.build.conclusion == 'success'
with:
name: junit-test-results
path: "*/build/test-results/test/TEST-*.xml"
Expand Down

0 comments on commit 2d462c1

Please sign in to comment.