Merge pull request #6 from OMOPHub/develop #62
This file contains hidden or 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
| on: | |
| push: | |
| branches: [main, master, develop] | |
| pull_request: | |
| branches: [main, master, develop] | |
| name: test-coverage | |
| jobs: | |
| test-coverage: | |
| # Only run on push to main/develop, not on PRs (saves ~5-7 min per PR) | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| OMOPHUB_API_KEY: ${{ secrets.OMOPHUB_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::covr | |
| needs: coverage | |
| cache-version: 2 | |
| - name: Test coverage | |
| run: | | |
| covr::codecov( | |
| quiet = FALSE, | |
| clean = FALSE, | |
| token = "${{ secrets.CODECOV_TOKEN }}", | |
| install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | |
| ) | |
| shell: Rscript {0} | |
| - name: Show testthat output | |
| if: always() | |
| run: | | |
| ## -------------------------------------------------------------------- | |
| find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true | |
| shell: bash | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-test-failures | |
| path: ${{ runner.temp }}/package |