mirror of
https://github.com/msberends/AMR.git
synced 2024-12-26 04:46:11 +01:00
176 lines
8.6 KiB
YAML
176 lines
8.6 KiB
YAML
# ==================================================================== #
|
|
# TITLE #
|
|
# Antimicrobial Resistance (AMR) Data Analysis for R #
|
|
# #
|
|
# SOURCE #
|
|
# https://github.com/msberends/AMR #
|
|
# #
|
|
# LICENCE #
|
|
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
|
# Developed at the University of Groningen, the Netherlands, in #
|
|
# collaboration with non-profit organisations Certe Medical #
|
|
# Diagnostics & Advice, and University Medical Center Groningen. #
|
|
# #
|
|
# 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. #
|
|
# #
|
|
# Visit our website for the full manual and a complete tutorial about #
|
|
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
|
|
# ==================================================================== #
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- premaster
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
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 * * *'
|
|
|
|
name: R-code-check
|
|
|
|
jobs:
|
|
R-code-check:
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
continue-on-error: ${{ matrix.config.allowfail }}
|
|
|
|
name: ${{ matrix.config.os }} (R-${{ matrix.config.r }})
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config:
|
|
- {os: macOS-latest, r: 'devel', allowfail: true}
|
|
- {os: macOS-latest, r: 'release', allowfail: false}
|
|
- {os: macOS-latest, r: 'oldrel', allowfail: false}
|
|
|
|
- {os: windows-latest, r: 'devel', allowfail: false}
|
|
- {os: windows-latest, r: 'release', allowfail: false}
|
|
- {os: windows-latest, r: 'oldrel', allowfail: false}
|
|
|
|
- {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"}
|
|
- {os: ubuntu-20.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
- {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"}
|
|
- {os: ubuntu-20.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
|
|
|
- {os: ubuntu-16.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
- {os: ubuntu-16.04, r: 'release', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
- {os: ubuntu-16.04, r: 'oldrel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
- {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"}
|
|
- {os: ubuntu-16.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
- {os: ubuntu-16.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
- {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"}
|
|
- {os: ubuntu-16.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
|
|
|
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
|
|
# if: matrix.config.r != '3.0'
|
|
# run: |
|
|
# saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
|
|
# shell: Rscript {0}
|
|
|
|
- name: Install Linux dependencies
|
|
if: runner.os == 'Linux'
|
|
# 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
|
|
run: |
|
|
sudo apt install -y libssl-dev pandoc pandoc-citeproc libxml2-dev libicu-dev libcurl4-openssl-dev
|
|
|
|
- name: Cache R packages
|
|
# if: runner.os != 'Windows'
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ${{ env.R_LIBS_USER }}
|
|
key: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-20
|
|
restore-keys: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-20
|
|
|
|
- name: Update AMR package dependencies
|
|
run: |
|
|
install.packages("data-raw/AMR_latest.tar.gz")
|
|
source("data-raw/_install_deps.R")
|
|
shell: Rscript {0}
|
|
|
|
- name: Session info
|
|
run: |
|
|
options(width = 100)
|
|
utils::sessionInfo()
|
|
as.data.frame(utils::installed.packages())[, "Version", drop = FALSE]
|
|
shell: Rscript {0}
|
|
|
|
- name: Run R CMD check on Windows
|
|
if: runner.os == 'Windows'
|
|
env:
|
|
_R_CHECK_CRAN_INCOMING_: false
|
|
_R_CHECK_FORCE_SUGGESTS_: false
|
|
_R_CHECK_DEPENDS_ONLY_: true
|
|
_R_CHECK_LENGTH_1_CONDITION_: verbose
|
|
_R_CHECK_LENGTH_1_LOGIC2_: verbose
|
|
R_LIBS_USER: ${{ env.R_LIBS_USER }}
|
|
R_TINYTEST: true
|
|
run: |
|
|
tar -xf data-raw/AMR_latest.tar.gz
|
|
rm -rf AMR/vignettes
|
|
R CMD check AMR
|
|
shell: bash
|
|
|
|
- name: Run R CMD check on Linux and macOS
|
|
if: runner.os != 'Windows'
|
|
env:
|
|
_R_CHECK_CRAN_INCOMING_: false
|
|
_R_CHECK_FORCE_SUGGESTS_: false
|
|
_R_CHECK_DEPENDS_ONLY_: true
|
|
_R_CHECK_LENGTH_1_CONDITION_: verbose
|
|
_R_CHECK_LENGTH_1_LOGIC2_: verbose
|
|
R_LIBS_USER: ${{ env.R_LIBS_USER }}
|
|
R_TINYTEST: true
|
|
run: |
|
|
tar -xf data-raw/AMR_latest.tar.gz
|
|
rm -rf AMR/vignettes
|
|
R CMD check AMR --no-manual --no-vignettes
|
|
shell: bash
|
|
|
|
- name: Show unit tests output
|
|
if: always()
|
|
run: |
|
|
find . -name 'tinytest.Rout*' -exec cat '{}' \; || true
|
|
shell: bash
|
|
|
|
- name: Upload check results
|
|
if: failure()
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
|
|
path: AMR.Rcheck
|