test-coverage.yaml #869
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: | |
- '*' | |
workflow_dispatch: | |
# pull_request: | |
# branches: | |
# - master | |
jobs: | |
R-CMD-check: | |
# If the commit message isn't [skip ci] | |
if: "!contains(github.event.commits[0].message, '[skip ci]')" | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
# - {os: windows-latest, r: 'release'} | |
# - {os: macOS-latest, r: 'release'} | |
- {os: ubuntu-latest, r: 'release'} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: | | |
rcmdcheck | |
remotes | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
architecture: 'x64' | |
- name: Install local registry | |
run: curl -fsSL https://data.scrc.uk/static/localregistry.sh | /bin/bash -s -- -b main | |
- name: Checkout FAIRDataPipeline/FAIR-CLI | |
uses: actions/checkout@v3 | |
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/bin/activate | |
cd ${{ github.workspace }} | |
fair init --ci | |
fair registry start | |
- name: Install R API system requirements (macOS-latest) | |
if: runner.os == 'macOS' | |
run : | | |
rm '/usr/local/bin/gfortran' | |
brew install hdf5 | |
brew install gdal | |
- name: Install R API system requirements (ubuntu-20.04) | |
if: matrix.config.os == 'ubuntu-20.04' | |
run: | | |
while read -r cmd | |
do | |
eval sudo $cmd | |
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")') | |
- name: Check | |
env: | |
_R_CHECK_CRAN_INCOMING_: false | |
_RUN_TESTS_: true | |
run: | | |
options(crayon.enabled = TRUE) | |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") | |
shell: Rscript {0} | |
- name: Show testthat output | |
if: always() | |
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
path: check |