Skip to content

Update test-coverage.yaml #530

Update test-coverage.yaml

Update test-coverage.yaml #530

# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:
name: test-coverage
jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
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: |
covr
pkgdown
remotes
- name: Install local registry
run: /bin/bash -c "$(curl -fsSL https://data.scrc.uk/static/localregistry.sh)"
- name: Start registry
run: $HOME/.fair/registry/scripts/start_fair_registry
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Install package
run: R CMD INSTALL .
- name: init
run: |
rDataPipeline::fair_init(
name = "Sonia Mitchell",
identifier = "https://orcid.org/0000-0003-1536-2066",
endpoint = "http://localhost:8000/api/")
shell: Rscript {0}
- name: Test coverage
env:
_RUN_TESTS_: true
run: covr::codecov()
shell: Rscript {0}