rhap individual countries #84
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: test_coverage | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| R-CMD: | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { os: ubuntu-latest, r: 'release' } | |
| env: | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| GITHUB_PAT: ${{ secrets.GH_RHAP_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.config.r }} | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-tinytex@v2 | |
| - name: Install system libraries | |
| if: startsWith(matrix.config.os, 'ubuntu') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libcurl4-openssl-dev libssl-dev libxml2-dev \ | |
| libudunits2-dev libgdal-dev libgeos-dev libproj-dev \ | |
| libmagick++-dev libavfilter-dev \ | |
| libharfbuzz-dev libfribidi-dev \ | |
| libfontconfig1-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev | |
| - name: Install R dependencies | |
| run: | | |
| options(repos = c(CRAN = "https://cloud.r-project.org")) | |
| install.packages(c("remotes", "rcmdcheck", "covr", "fs", "usethis")) | |
| remotes::install_deps(dependencies = TRUE, upgrade = "never") | |
| shell: Rscript {0} | |
| - name: Install the package | |
| run: | | |
| remotes::install_local(".") | |
| shell: Rscript {0} | |
| - name: Run tests and generate coverage | |
| run: | | |
| cov <- covr::package_coverage() | |
| covr::to_cobertura(cov, "coverage.xml") | |
| shell: Rscript {0} | |
| - uses: codecov/codecov-action@v4.0.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # Optional if repo is public | |
| files: ./coverage.xml | |
| verbose: true | |