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

Not Able to download artifacts for Java Unit Test Report #543

Open
umangm99 opened this issue Nov 14, 2024 · 0 comments
Open

Not Able to download artifacts for Java Unit Test Report #543

umangm99 opened this issue Nov 14, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@umangm99
Copy link

Describe the bug

Hi Dorny I'm struggling with Java Unit Test reporting, I have tried multiple options. Below is my github action yaml. I hope you can help

jobs:
build:
runs-on: ubuntu
name: CI Build
steps:
- name: Checkout code
uses: actions/checkout@v4

  - name: Set up JDK 8
    uses: actions/setup-java@v4
    with:
      java-version: '8'
      distribution: 'temurin'

  - name: Cache local Maven repository
    uses: actions/cache@v4
    with:
      path: ~/.m2/repository
      key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
      restore-keys: |
        ${{ runner.os }}-maven-

  - name: Build with Maven
    if: ${{ github.ref_name != 'release/ready' }}
    run: mvn -B package --file pom.xml

  - name: Publish the Test reports in Junit xml format
    id: publish-test-reports
    uses: actions/upload-artifact@v4
    if: always()
    with:
      name: 'maven-test-reports'
      path: '*/target/surefire-reports/*.xml'

analyze-test-results:
needs: build
runs-on: default
steps:
- uses: actions/download-artifact@v4
with:
name: 'maven-test-reports'
- name: Display structure of downloaded files
run: ls -R
- name: Analyse Test Results
uses: dorny/test-reporter@v1
if: success() # Run only if the previous step was successful
with:
name: Junit Tests # Name of the check run which will be created
path: '*.xml' # Path to test results
reporter: java-junit

Screenshot 2024-11-14 at 11 22 34 PM Screenshot 2024-11-14 at 11 23 10 PM
@umangm99 umangm99 added the bug Something isn't working label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants