description v2 #2
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
| # test-coverage.yml | |
| # Workflow to compute and upload code coverage to Codecov | |
| # Derived from https://github.com/r-lib/actions/tree/v2/examples | |
| name: test-coverage | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-coverage: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::covr | |
| needs: coverage | |
| - name: Install package | |
| run: R CMD INSTALL . | |
| - name: Run test coverage | |
| run: | | |
| coverage <- covr::package_coverage(quiet = FALSE) | |
| print(coverage) | |
| covr::codecov(coverage = coverage, quiet = FALSE) | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # Requiere crear el token en codecov.io | |
| fail_ci_if_error: true | |
| verbose: true |