-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (93 loc) · 2.98 KB
/
test-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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