Repository navigation
test to run #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
| name: R tests and coverage | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: release | |
| - name: Install test dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| packages: | | |
| any::testthat | |
| any::covr | |
| any::jsonlite | |
| - name: Run tests | |
| working-directory: tests | |
| run: Rscript testthat.R | |
| - name: Report coverage | |
| working-directory: tests | |
| run: Rscript coverage.R | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage-report/ | |
| - name: Update coverage badge | |
| if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
| uses: we-cli/coverage-badge-action@v1.0.1 |