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

Junit Report data is lost when multiple workflow run with this action #21

Open
orestesgaolin opened this issue Aug 6, 2020 · 2 comments

Comments

@orestesgaolin
Copy link

orestesgaolin commented Aug 6, 2020

I have multiple workflows configured for PRs, each can be triggered depending on the files changed in the PR.

Unfortunately the Junit Results annotations are present only in the first workflow and they are not visible in any other. All of them have very similar workflow files (with slight changes to paths)
image

The results are shown correctly if there's only 1 workflow triggered that contains junit-report-annotations-action

Sample workflow.yaml:

name: user_repository

on:
  pull_request:
    paths:
      - "packages/user_repository/**"
      - ".github/workflows/user_repository.yaml"

jobs:
  build:
    defaults:
      run:
        working-directory: packages/user_repository

    runs-on: ubuntu-latest

    container:
      image: google/dart:2.8.4

    steps:
      - uses: actions/checkout@v2

      - name: Install Dependencies
        run: pub get

      - name: Format
        run: dartfmt --dry-run --set-exit-if-changed .

      - name: Analyze
        run: dartanalyzer --fatal-infos --fatal-warnings lib test

      - name: Check TODOs
        run: ../../tool/check_todos.sh .

      - name: Run tests
        run: pub run test --reporter json > test.log

      - name: Convert to junit
        run: |
          pub global activate junitreport
          export PATH="$PATH":"$HOME/.pub-cache/bin"
          cat test.log
          cat test.log | tojunit > TEST.xml
        if: always()

      - uses: ashley-taylor/junit-report-annotations-action@master
        with:
          access-token: ${{ secrets.GITHUB_TOKEN }}
          path: "**/TEST.xml"
          includeSummary: true
        if: always()

      - name: Run tests with coverage
        run: pub run test_coverage

      - name: Publish Coverage
        shell: bash
        run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}

      - name: Check Code Coverage
        uses: ChicagoFlutter/[email protected]
        with:
          path: packages/user_repository/coverage/lcov.info

I can share more info via DM/Slack/email

@TurpIF
Copy link
Contributor

TurpIF commented Aug 6, 2020

Hello,

I believe that you can override the name of those report by using the name parameter (see

).

Although, this could be automatically handled by:

  • merging annotations
  • reusing name of current GitHub job
  • auto incrementing reports name

I don't know if merging or getting job name are technically possible. And I personally think that auto incrementing is not a solution, as the outcome would not be usable.

@ashley-taylor do you have any thoughts on this ?

Your issue shows another: the readme does not help integration and I believe that improving the readme could bring a lot to this project.

@orestesgaolin
Copy link
Author

I wonder if the action could get the current check id?

Here they are using only current sha.

Here they are using check id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants