Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PR validation permissions by splitting in two workflows #459

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

@NiccoMlt NiccoMlt Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use actions/upload-artifact@v4 for now, see dorny/test-reporter#363.

actions/upload-artifact@v3 is fine though

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
Loading