-
Notifications
You must be signed in to change notification settings - Fork 10
60 lines (57 loc) · 1.85 KB
/
check.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
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
R-CMD-check:
name: R CMD check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
steps:
- uses: actions/checkout@v4
- name: Set up Conda env
uses: mamba-org/provision-with-micromamba@e2b397b12d0a38069451664382b769c9456e3d6d
with:
cache-env: true
- name: Install TinyTex
shell: bash -l {0}
run: |
Rscript -e 'tinytex::install_tinytex()'
- name: Install demo datasets
shell: bash -l {0}
run: |
Rscript -e 'install.packages("eicu.demo", repos="https://eth-mds.github.io/physionet-demo")'
- name: Run R CMD check
shell: bash -l {0}
run: |
R CMD build . && R CMD check --no-manual --as-cran $(ls -t . | head -n1)
env:
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_FORCE_SUGGESTS_: false
# R CMD check raises a warning by qpdf that the generated docs PDF is large and
# should be compressed. Currently we ignore this warning via the grep below.
- name: Check for warnings
shell: bash -l {0}
run: |
CHECK_LOG_FILE=ricu.Rcheck/00check.log
CHECK_INSTALL_FILE=ricu.Rcheck/00install.out
if ! [[ -f "$CHECK_LOG_FILE" ]]; then
echo "Log-file not found."
exit 1
fi
if cat $CHECK_LOG_FILE | grep -q "ERROR"; then
cat $CHECK_INSTALL_FILE
cat $CHECK_LOG_FILE
exit 1
fi
if cat $CHECK_LOG_FILE | grep -q "WARNING" | grep -q -v -e "checking sizes of PDF files under ‘inst/doc’ ... WARNING"; then
echo "Found warnings, treated as errors."
cat $CHECK_LOG_FILE
exit 1
fi