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

coverageCommand should not be required setting #182

Closed
insspb opened this issue May 22, 2020 · 4 comments · Fixed by #232
Closed

coverageCommand should not be required setting #182

insspb opened this issue May 22, 2020 · 4 comments · Fixed by #232
Assignees
Labels
enhancement New feature or request

Comments

@insspb
Copy link

insspb commented May 22, 2020

Describe the bug

When repository uses several coverage sites uploads are made after test runs complete. So no need to rerun coverage.

Version of codeclimate-action you're using
v2.5.7

Example links

  1. https://github.com/insspb/ikt/pull/29/checks?check_run_id=700558166

Expected behavior
In example at the link echo command used as placeholder. This should be avoided.

@insspb insspb added the bug Something isn't working label May 22, 2020
@ChristopherBull
Copy link

Yup - an issue for me too.

I perform the following step which runs a command using an emulator:

    - name: Android tests and coverage
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 29
          script: ./gradlew createDebugCoverageReport

If I were to use codeclimate-action, coverageCommand would essentially repeat the previous coverage step.

@paambaati paambaati added enhancement New feature or request and removed bug Something isn't working labels Sep 22, 2020
@paambaati
Copy link
Owner

Can you folks help me understand this a little better? Are you saying you've already generated coverage output in a previous step and only need this action to simply upload the coverage output?

@ChristopherBull
Copy link

@paambaati Yes.

The command I use to generate the coverage report is required by another GitHub Action. So I use your action just to upload to Code Climate.

For example:

      - name: Android tests (unit and instrumented)
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 29
          # Runs: Build, unit tests, instrumented tests, then generates and combines coverage reports
          script: ./gradlew jacocoCombinedTestReports
      - name: Upload coverage to Code-Climate
        uses: paambaati/codeclimate-action@v2.6.0
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
          JACOCO_SOURCE_PATH: "${{github.workspace}}/app/src/main/java"
        with:
          # coverageCommand is required, but as coverage is calculated in previous step, skip by using 'echo'
          coverageCommand: echo "Coverage already calculated - skipping calculating coverage"
          coverageLocations: ${{github.workspace}}/app/build/reports/coverage/jacocoCombinedTestReports/jacocoCombinedTestReports.xml:jacoco

@paambaati
Copy link
Owner

This is now available in v2.7.1!

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

Successfully merging a pull request may close this issue.

3 participants