Created
August 23, 2023 17:13
-
-
Save oleksandr-jr/3241408932eac24c79f0c4a22ee89e45 to your computer and use it in GitHub Desktop.
JR-M3-L5-TestProject-github-action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
issues: read | |
checks: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Run tests with Maven | |
run: mvn --batch-mode --update-snapshots test | |
- name: Tests Report 1 | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
target/surefire-reports/*.xml | |
report_individual_runs: true | |
- name: Tests Report 2 | |
uses: dorny/test-reporter@v1 | |
if: always() # run this step even if previous step failed | |
with: | |
name: Tests Report 2 # Name of the check run which will be created | |
path: target/surefire-reports/*.xml # Path to test results | |
reporter: java-junit # Format of test results | |
- name: Test Report 3 | |
uses: mikepenz/action-junit-report@v3 | |
if: always() # always run even if the previous step fails | |
with: | |
report_paths: 'target/surefire-reports/*.xml' | |
- name: Upload test results to testhub.io | |
if: always() | |
uses: testhub-io/testhub-io.action@v0.62 | |
with: | |
test_result_pattern: "target/surefire-reports/*.xml" | |
test_coverage_pattern: "target/site/jacoco/jacoco.xml" | |
- name: Show logs | |
run: cd logs && ls -R && echo '\n' && grep . * | |
if: always() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment