AMR/.github/workflows/check-old.yaml

123 lines
5.2 KiB
YAML
Raw Normal View History

2020-07-08 14:48:06 +02:00
# ==================================================================== #
# TITLE: #
2022-10-05 09:12:22 +02:00
# AMR: An R Package for Working with Antimicrobial Resistance Data #
2020-07-08 14:48:06 +02:00
# #
# SOURCE CODE: #
2020-07-08 14:48:06 +02:00
# https://github.com/msberends/AMR #
# #
# PLEASE CITE THIS SOFTWARE AS: #
2022-10-05 09:12:22 +02:00
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
# Data. Journal of Statistical Software, 104(3), 1-31. #
2023-05-27 10:39:22 +02:00
# https://doi.org/10.18637/jss.v104.i03 #
2022-10-05 09:12:22 +02:00
# #
2022-12-27 15:16:15 +01:00
# Developed at the University of Groningen and the University Medical #
# Center Groningen in The Netherlands, in collaboration with many #
# colleagues from around the world, see our website. #
2020-07-08 14:48:06 +02:00
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
2020-10-08 11:16:03 +02:00
# #
# Visit our website for the full manual and a complete tutorial about #
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
2020-07-08 14:48:06 +02:00
# ==================================================================== #
on:
push:
2023-01-05 15:41:07 +01:00
# only run after a git push on any branch in this repo
2022-08-21 17:22:34 +02:00
branches: '**'
2020-07-08 14:48:06 +02:00
2022-10-29 14:15:23 +02:00
name: check-old
2020-07-08 14:48:06 +02:00
jobs:
2020-07-08 20:43:25 +02:00
R-code-check:
2020-07-08 14:48:06 +02:00
runs-on: ${{ matrix.config.os }}
2022-10-05 09:12:22 +02:00
continue-on-error: ${{ matrix.config.allowfail }}
2020-07-08 14:48:06 +02:00
name: ${{ matrix.config.os }} (R-${{ matrix.config.r }})
2020-07-08 14:48:06 +02:00
strategy:
fail-fast: false
matrix:
config:
2023-01-05 15:03:18 +01:00
# Test all old versions of R >= 3.0, we support them all!
2023-01-06 13:35:37 +01:00
# For these old versions, dependencies and vignettes will not be checked.
2023-05-26 20:37:00 +02:00
# For recent R versions, see check-recent.yaml (r-lib and tidyverse support the latest 5 major R releases).
2023-07-12 12:41:25 +02:00
# - {os: windows-latest, r: '3.5', allowfail: true} # always fails, horrible with UTF-8
2023-01-21 23:53:31 +01:00
- {os: ubuntu-latest, r: '3.4', allowfail: false}
- {os: ubuntu-latest, r: '3.3', allowfail: false}
- {os: ubuntu-latest, r: '3.2', allowfail: false}
- {os: ubuntu-latest, r: '3.1', allowfail: false}
- {os: ubuntu-latest, r: '3.0', allowfail: false}
2023-01-05 18:21:48 +01:00
2020-07-08 14:48:06 +02:00
env:
2021-09-29 20:24:02 +02:00
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
2022-10-05 09:12:22 +02:00
2020-07-08 14:48:06 +02:00
steps:
2022-08-26 23:25:37 +02:00
- uses: actions/checkout@v3
2020-07-08 14:48:06 +02:00
2021-12-22 09:44:10 +01:00
- uses: r-lib/actions/setup-r@v2
2020-07-08 14:48:06 +02:00
with:
r-version: ${{ matrix.config.r }}
2022-10-05 09:12:22 +02:00
2021-12-22 09:44:10 +01:00
- uses: r-lib/actions/setup-pandoc@v2
2021-10-03 13:50:52 +02:00
2023-01-21 23:53:31 +01:00
- name: Install tinytest from CRAN
2021-10-03 13:50:52 +02:00
run: |
2023-01-21 23:53:31 +01:00
install.packages("tinytest", repos = "https://cran.r-project.org")
2023-01-06 11:22:02 +01:00
shell: Rscript {0}
2022-10-05 09:12:22 +02:00
2021-05-16 09:25:36 +02:00
- name: Show session info
if: always()
2020-07-08 14:48:06 +02:00
run: |
options(width = 100)
2020-12-29 21:23:01 +01:00
utils::sessionInfo()
as.data.frame(utils::installed.packages())[, "Version", drop = FALSE]
2020-07-08 14:48:06 +02:00
shell: Rscript {0}
2022-10-05 09:12:22 +02:00
2023-01-06 13:35:37 +01:00
- name: Remove vignettes
if: always() # matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2' || matrix.config.r == '3.3'
2022-08-28 20:10:05 +02:00
# writing to DESCRIPTION2 and then moving to DESCRIPTION is required for R <= 3.3 as writeLines() cannot overwrite
2021-10-03 23:49:46 +02:00
run: |
2022-08-28 20:10:05 +02:00
rm -rf vignettes
Rscript -e "writeLines(readLines('DESCRIPTION')[!grepl('VignetteBuilder', readLines('DESCRIPTION'))], 'DESCRIPTION2')"
rm DESCRIPTION
mv DESCRIPTION2 DESCRIPTION
2021-10-03 23:49:46 +02:00
shell: bash
2023-01-05 18:21:48 +01:00
2021-10-03 13:50:52 +02:00
- name: Run R CMD check
if: always()
2021-09-29 16:43:05 +02:00
env:
2022-08-28 20:49:04 +02:00
# see https://rstudio.github.io/r-manuals/r-ints/Tools.html for an overview
2021-09-29 20:10:44 +02:00
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_DEPENDS_ONLY_: true
_R_CHECK_LENGTH_1_CONDITION_: verbose
_R_CHECK_LENGTH_1_LOGIC2_: verbose
2022-08-28 20:49:04 +02:00
# no check for old R versions - these packages require higher R versions
2023-01-06 13:35:37 +01:00
_R_CHECK_RD_XREFS_: false
2022-08-28 20:49:04 +02:00
_R_CHECK_FORCE_SUGGESTS_: false
R_CHECK_CONSTANTS: 5
R_JIT_STRATEGY: 3
2021-09-29 16:43:05 +02:00
# during 'R CMD check', R_LIBS_USER will be overwritten, so:
R_LIBS_USER_GH_ACTIONS: ${{ env.R_LIBS_USER }}
2022-08-28 19:17:12 +02:00
# this is a required value to run the unit tests:
2021-10-03 13:50:52 +02:00
R_RUN_TINYTEST: true
run: |
2022-08-28 16:03:23 +02:00
cd ..
R CMD build AMR
2022-08-28 20:49:04 +02:00
R CMD check --as-cran --no-manual --run-donttest --run-dontrun AMR_*.tar.gz
2021-10-03 13:50:52 +02:00
shell: bash
2023-01-05 18:21:48 +01:00
- name: Show tinytest output
2020-07-08 14:48:06 +02:00
if: always()
2021-10-03 13:50:52 +02:00
run: |
2022-08-28 20:10:05 +02:00
cd ../AMR.Rcheck
2021-10-03 13:50:52 +02:00
find . -name 'tinytest.Rout*' -exec cat '{}' \; || true
2020-07-08 14:48:06 +02:00
shell: bash