Skip to content

Commit

Permalink
Split PR validation in two workflows (#459)
Browse files Browse the repository at this point in the history
see https://github.com/marketplace/actions/test-reporter#recommended-setup-for-public-repositories

fix permissions in PR validation workflow

Update pr-validation.yml

Update pr-validation-report.yml
  • Loading branch information
NiccoMlt authored Feb 21, 2024
1 parent 1edf21d commit bfe0752
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pr-validation-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Java CI - Test report
on:
workflow_run:
workflows:
- 'Java CI - Code tests'
types:
- completed
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: test-results # as named in pr-validation workflow
name: Maven Tests
path: carapace-*/target/surefire-reports/*.xml # (inside artifact .zip)
reporter: java-junit
12 changes: 3 additions & 9 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
name: Java CI - Code tests
on:
pull_request:
permissions:
contents: read
actions: read
checks: write
env:
MAVEN_OPTS: >-
-Dmaven.artifact.threads=4
Expand Down Expand Up @@ -48,11 +44,9 @@ jobs:
cache: 'maven'
- name: 'Build and test with Maven'
run: mvn verify
- name: 'Report test results'
uses: dorny/test-reporter@v1
- uses: actions/upload-artifact@v3
if: always()
with:
name: Maven Tests
name: test-results # as expected by pr-validation-report workflow
path: carapace-*/target/surefire-reports/*.xml
reporter: java-junit
fail-on-error: true
retention-days: 1

0 comments on commit bfe0752

Please sign in to comment.