From 00493ef26646843eb3c0eadd6d01aad99c07f9c6 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Tue, 20 May 2025 09:49:20 +0200 Subject: [PATCH 1/3] Update check.yaml ci --- .github/workflows/check.yaml | 78 +++++++++++++++++------------------- environment.yaml | 41 +++++++++++++++++++ 2 files changed, 78 insertions(+), 41 deletions(-) create mode 100644 environment.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index a3ea0c3d..e98bbb8a 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -6,55 +6,51 @@ 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 Conda env + uses: mamba-org/provision-with-micromamba@e2b397b12d0a38069451664382b769c9456e3d6d with: - extra-packages: | - any::rcmdcheck - eth-mds/mimic-demo - eth-mds/eicu-demo - nbenn/mockthat - - - uses: r-lib/actions/check-r-package@v2 + cache-env: true + - 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.yaml b/environment.yaml new file mode 100644 index 00000000..2c418c13 --- /dev/null +++ b/environment.yaml @@ -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 From 23ca8d55e748aa77456636547e35539448aba3d1 Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Tue, 20 May 2025 09:54:00 +0200 Subject: [PATCH 2/3] Should be environment.yml not yaml --- environment.yaml => environment.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename environment.yaml => environment.yml (100%) diff --git a/environment.yaml b/environment.yml similarity index 100% rename from environment.yaml rename to environment.yml From c5853b48d6928ca9ab2338794725bc9cb2eb052f Mon Sep 17 00:00:00 2001 From: Malte Londschien Date: Tue, 20 May 2025 10:07:06 +0200 Subject: [PATCH 3/3] Use setup-micromamba --- .github/workflows/check.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index e98bbb8a..8c4d1779 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -18,10 +18,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Conda env - uses: mamba-org/provision-with-micromamba@e2b397b12d0a38069451664382b769c9456e3d6d + - name: Set up micromamba + uses: mamba-org/setup-micromamba@d05808540d968a55ca33c798e0661fb98f533c73 with: + micromamba-version: 1.5.10-0 cache-env: true + environment-file: environment.yml - name: Install TinyTex shell: bash -l {0} run: |