updated actions and pkgdown config #23
This file contains 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 | |
pull_request: | |
branches: | |
- main | |
name: test-coverage | |
jobs: | |
test-coverage: | |
# shell needs to use login mode so conda env activation can work | |
defaults: | |
run: | |
shell: bash -l {0} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: latest | |
activate-environment: my-env | |
- name: Update PATH env variable to include conda bin dir (Linux and MacOS) | |
run: echo "PATH=$PATH" >> $GITHUB_ENV | |
if: runner.os != 'Windows' | |
- name: Install osmium | |
run: conda install -c conda-forge osmium-tool | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::covr, any::xml2 | |
needs: coverage | |
- name: Test coverage | |
run: | | |
cov <- covr::package_coverage( | |
quiet = FALSE, | |
clean = FALSE, | |
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | |
) | |
covr::to_cobertura(cov) | |
shell: Rscript {0} | |
- uses: codecov/codecov-action@v4 | |
with: | |
# Fail if error if not on PR, or if on PR and token is given | |
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} | |
file: ./cobertura.xml | |
plugin: noop | |
disable_search: true | |
token: ${{ secrets.CODECOV_TOKEN }} |