Skip to content

Update Actions

Update Actions #539

Workflow file for this run

# 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: Checkout FAIRDataPipeline/FAIR-CLI
uses: actions/checkout@v4
with:
repository: FAIRDataPipeline/FAIR-CLI
path: FAIR-CLI
- name: Move FAIR-CLI
run: mv FAIR-CLI ../FAIR-CLI
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install and initialise FAIR CLI
run: |
cd ../FAIR-CLI
poetry install
source $VENV
cd '${{ github.workspace }}'
fair registry install --version main
fair init --ci
fair registry start
shell: bash
- 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://127.0.0.1:8000/api/")
shell: Rscript {0}
- name: Test coverage
env:
_RUN_TESTS_: true
run: covr::codecov()
shell: Rscript {0}