2020-07-08 14:48:06 +02:00
|
|
|
# ==================================================================== #
|
|
|
|
# TITLE #
|
2021-02-02 23:57:35 +01:00
|
|
|
# Antimicrobial Resistance (AMR) Data Analysis for R #
|
2020-07-08 14:48:06 +02:00
|
|
|
# #
|
|
|
|
# SOURCE #
|
|
|
|
# https://github.com/msberends/AMR #
|
|
|
|
# #
|
|
|
|
# LICENCE #
|
2020-12-27 00:30:28 +01:00
|
|
|
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
2020-10-08 11:16:03 +02:00
|
|
|
# Developed at the University of Groningen, the Netherlands, in #
|
|
|
|
# collaboration with non-profit organisations Certe Medical #
|
|
|
|
# Diagnostics & Advice, and University Medical Center Groningen. #
|
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 #
|
2021-02-02 23:57:35 +01:00
|
|
|
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
|
2020-07-08 14:48:06 +02:00
|
|
|
# ==================================================================== #
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- premaster
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-08-29 21:41:46 +02:00
|
|
|
schedule:
|
|
|
|
# run a schedule everyday at 3 AM.
|
|
|
|
# this is to check that all dependencies are still available (see R/zzz.R)
|
|
|
|
- cron: '0 3 * * *'
|
2020-07-08 14:48:06 +02:00
|
|
|
|
2020-07-08 20:43:25 +02:00
|
|
|
name: R-code-check
|
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 }}
|
2020-10-26 15:53:31 +01:00
|
|
|
|
|
|
|
continue-on-error: ${{ matrix.config.allowfail }}
|
2020-07-08 14:48:06 +02:00
|
|
|
|
2020-10-26 15:53:31 +01:00
|
|
|
name: ${{ matrix.config.os }} (R-${{ matrix.config.r }})
|
2020-07-08 14:48:06 +02:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
2020-10-27 15:56:51 +01:00
|
|
|
- {os: macOS-latest, r: 'devel', allowfail: false}
|
|
|
|
- {os: macOS-latest, r: 'release', allowfail: false}
|
|
|
|
- {os: macOS-latest, r: 'oldrel', allowfail: false}
|
2021-02-21 22:56:35 +01:00
|
|
|
|
2020-10-27 15:56:51 +01:00
|
|
|
- {os: windows-latest, r: 'devel', allowfail: false}
|
|
|
|
- {os: windows-latest, r: 'release', allowfail: false}
|
|
|
|
- {os: windows-latest, r: 'oldrel', allowfail: false}
|
2021-02-21 22:56:35 +01:00
|
|
|
|
2021-01-12 22:08:04 +01:00
|
|
|
- {os: ubuntu-20.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
- {os: ubuntu-20.04, r: 'release', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
- {os: ubuntu-20.04, r: 'oldrel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
- {os: ubuntu-20.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
- {os: ubuntu-20.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
- {os: ubuntu-20.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
- {os: ubuntu-20.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
2021-04-16 12:02:57 +02:00
|
|
|
- {os: ubuntu-20.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
2021-04-12 14:24:40 +02:00
|
|
|
# - {os: ubuntu-20.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
# - {os: ubuntu-20.04, r: '3.1', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
2021-04-16 11:41:05 +02:00
|
|
|
- {os: ubuntu-20.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
2021-02-21 22:56:35 +01:00
|
|
|
|
2021-01-03 23:40:05 +01:00
|
|
|
- {os: ubuntu-16.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2020-10-27 15:56:51 +01:00
|
|
|
- {os: ubuntu-16.04, r: 'release', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2021-01-03 23:40:05 +01:00
|
|
|
- {os: ubuntu-16.04, r: 'oldrel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2020-10-27 15:56:51 +01:00
|
|
|
- {os: ubuntu-16.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
|
|
- {os: ubuntu-16.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
|
|
- {os: ubuntu-16.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2021-01-03 23:40:05 +01:00
|
|
|
- {os: ubuntu-16.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2021-04-16 11:41:05 +02:00
|
|
|
- {os: ubuntu-16.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2021-04-12 14:24:40 +02:00
|
|
|
# - {os: ubuntu-16.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
|
|
# - {os: ubuntu-16.04, r: '3.1', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2021-04-16 11:41:05 +02:00
|
|
|
- {os: ubuntu-16.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
2021-01-03 23:40:05 +01:00
|
|
|
|
2020-07-08 14:48:06 +02:00
|
|
|
env:
|
|
|
|
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
|
|
|
|
RSPM: ${{ matrix.config.rspm }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: r-lib/actions/setup-r@master
|
|
|
|
with:
|
|
|
|
r-version: ${{ matrix.config.r }}
|
|
|
|
|
|
|
|
- uses: r-lib/actions/setup-pandoc@master
|
|
|
|
|
|
|
|
- name: Query dependencies
|
2020-12-29 21:23:01 +01:00
|
|
|
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
2020-07-08 14:48:06 +02:00
|
|
|
run: |
|
|
|
|
install.packages('remotes')
|
|
|
|
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
|
|
|
|
shell: Rscript {0}
|
|
|
|
|
|
|
|
- name: Cache R packages
|
2021-01-04 11:27:37 +01:00
|
|
|
if: runner.os != 'Windows' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
2020-07-08 14:48:06 +02:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ env.R_LIBS_USER }}
|
2021-01-03 23:40:05 +01:00
|
|
|
key: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }}
|
|
|
|
restore-keys: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-3-
|
2020-07-08 14:48:06 +02:00
|
|
|
|
2020-11-17 11:53:56 +01:00
|
|
|
- name: Install Linux dependencies
|
2021-01-04 11:27:37 +01:00
|
|
|
if: runner.os == 'Linux' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
|
|
|
env:
|
|
|
|
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
|
|
|
|
run: |
|
|
|
|
Rscript -e "remotes::install_github('r-hub/sysreqs')"
|
|
|
|
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
|
|
|
|
sudo -s eval "$sysreqs"
|
|
|
|
|
|
|
|
- name: Install Linux dependencies on old R versions
|
|
|
|
if: matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2'
|
2020-07-08 14:48:06 +02:00
|
|
|
env:
|
|
|
|
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
|
2021-01-03 23:40:05 +01:00
|
|
|
# update the below with sysreqs::sysreqs("DESCRIPTION") and check the "DEB" entries (for Ubuntu).
|
|
|
|
# we don't want to depend on the sysreqs pkg here, as it requires a quite new R version
|
2020-07-08 14:48:06 +02:00
|
|
|
run: |
|
2021-01-03 23:40:05 +01:00
|
|
|
sudo apt install -y libssl-dev pandoc pandoc-citeproc libxml2-dev libicu-dev libcurl4-openssl-dev
|
2020-07-08 14:48:06 +02:00
|
|
|
|
2020-10-15 09:46:41 +02:00
|
|
|
- name: Install macOS dependencies
|
|
|
|
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel'
|
|
|
|
run: |
|
|
|
|
brew install mariadb-connector-c
|
|
|
|
|
2021-01-04 12:29:25 +01:00
|
|
|
- name: Install package dependencies
|
2021-01-04 11:27:37 +01:00
|
|
|
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
2020-07-08 14:48:06 +02:00
|
|
|
run: |
|
2021-01-04 11:27:37 +01:00
|
|
|
remotes::install_deps(dependencies = TRUE)
|
|
|
|
remotes::install_cran("rcmdcheck")
|
2020-07-08 14:48:06 +02:00
|
|
|
shell: Rscript {0}
|
|
|
|
|
|
|
|
- name: Session info
|
|
|
|
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}
|
|
|
|
|
2021-01-04 12:29:25 +01:00
|
|
|
- name: Run R CMD check
|
|
|
|
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
|
|
|
env:
|
|
|
|
_R_CHECK_CRAN_INCOMING_: false
|
2021-04-12 12:35:13 +02:00
|
|
|
_R_CHECK_LENGTH_1_CONDITION_: verbose
|
|
|
|
_R_CHECK_LENGTH_1_LOGIC2_: verbose
|
2021-01-04 12:29:25 +01:00
|
|
|
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
|
|
|
|
shell: Rscript {0}
|
2020-12-29 21:23:01 +01:00
|
|
|
|
|
|
|
- name: Run R CMD check on older R versions
|
2021-01-04 12:29:25 +01:00
|
|
|
if: matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2'
|
2020-12-29 21:23:01 +01:00
|
|
|
env:
|
|
|
|
_R_CHECK_CRAN_INCOMING_: false
|
|
|
|
_R_CHECK_FORCE_SUGGESTS_: false
|
2021-04-12 12:35:13 +02:00
|
|
|
_R_CHECK_DEPENDS_ONLY_: true
|
2020-12-31 13:44:58 +01:00
|
|
|
_R_CHECK_LENGTH_1_CONDITION_: verbose
|
|
|
|
_R_CHECK_LENGTH_1_LOGIC2_: verbose
|
2020-12-29 21:23:01 +01:00
|
|
|
run: |
|
2021-04-07 08:37:42 +02:00
|
|
|
tar -xvf data-raw/AMR_latest.tar.gz
|
|
|
|
R CMD check AMR --no-manual --no-build-vignettes
|
2020-07-08 14:48:06 +02:00
|
|
|
|
|
|
|
- name: Show testthat output
|
|
|
|
if: always()
|
|
|
|
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Upload check results
|
|
|
|
if: failure()
|
2020-10-15 09:46:41 +02:00
|
|
|
uses: actions/upload-artifact@master
|
2020-07-08 14:48:06 +02:00
|
|
|
with:
|
2021-01-04 09:49:42 +01:00
|
|
|
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
|
2020-07-08 14:48:06 +02:00
|
|
|
path: check
|