Enable tests on CI #174
Workflow file for this run
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: | |
- 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 |