diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index a3ea0c3d..8c4d1779 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -6,55 +6,53 @@ on: branches: - main -name: check - jobs: - check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + R-CMD-check: + name: R CMD check (${{ matrix.os }}) + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - config: - - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes + os: ['ubuntu-latest'] steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-tinytex@v2 - - run: tlmgr --version - - - 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 + - uses: actions/checkout@v4 + - name: Set up micromamba + uses: mamba-org/setup-micromamba@d05808540d968a55ca33c798e0661fb98f533c73 with: - extra-packages: | - any::rcmdcheck - eth-mds/mimic-demo - eth-mds/eicu-demo - nbenn/mockthat - - - uses: r-lib/actions/check-r-package@v2 + micromamba-version: 1.5.10-0 + cache-env: true + environment-file: environment.yml + - name: Install TinyTex + shell: bash -l {0} + run: | + Rscript -e 'tinytex::install_tinytex()' + - 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_CHECK_DOC_SIZES_: false - with: - upload-snapshots: true + # 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 \ No newline at end of file diff --git a/environment.yml b/environment.yml new file mode 100644 index 00000000..2c418c13 --- /dev/null +++ b/environment.yml @@ -0,0 +1,41 @@ +name: ricu +channels: + - nodefaults + - conda-forge +dependencies: + - r-base + - r-data.table + - r-curl + - r-assertthat + - r-fst + - r-readr + - r-jsonlite + - r-prt>=0.1.2 + - r-tibble + - r-backports + - r-rlang + - r-vctrs + - r-cli>=2.1.0 + - r-fansi + - r-openssl + # optional + - r-rticles + - r-forestmodel + - r-ggplot2 + - r-survival + - r-kableExtra + - r-magick + - r-cowplot + - r-knitr + - r-pdftools + - r-covr + - r-units + - r-tinytex + - r-testthat + - r-mockthat + - r-pkgload + - r-codetools + - r-qpdf + - qpdf + - r-mimic.demo + - r-eicu.demo \ No newline at end of file