diff --git a/.github/workflows/codecovr.yaml b/.github/workflows/codecovr.yaml index 5b2fed0f..bdf48c40 100644 --- a/.github/workflows/codecovr.yaml +++ b/.github/workflows/codecovr.yaml @@ -43,39 +43,40 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master - + - uses: r-lib/actions/setup-r@v1 + with: + r-version: release + - uses: r-lib/actions/setup-pandoc@master - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages + - name: Restore cached R packages + # this step will add the step 'Post Restore cached R packages' on a succesful run uses: actions/cache@v1 with: path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + key: macOS-latest-r-release-v4 - - name: Install dependencies + - name: Unpack AMR and install R dependencies run: | - install.packages(c("remotes", "tinytest")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - remotes::install_local("data-raw/AMR_latest.tar.gz") + tar -xf data-raw/AMR_latest.tar.gz + Rscript -e "source('data-raw/_install_deps.R')" + Rscript -e "install.packages('covr')" + shell: bash + + - name: Show session info + run: | + options(width = 100) + utils::sessionInfo() + as.data.frame(utils::installed.packages())[, "Version", drop = FALSE] shell: Rscript {0} - name: Test coverage run: | library(AMR) library(tinytest) - source_files <- list.files("R", pattern = ".R$", full.names = TRUE) - test_files <- list.files("inst/tinytest", full.names = TRUE) + source_files <- list.files("AMR/R", pattern = ".R$", full.names = TRUE) + test_files <- list.files("AMR/inst/tinytest", full.names = TRUE) cov <- covr::file_coverage(source_files = source_files, test_files = test_files, parent_env = asNamespace("AMR"), line_exclusions = list("R/atc_online.R", "R/mo_source.R", "R/translate.R", "R/resistance_predict.R", "R/aa_helper_functions.R", "R/aa_helper_pm_functions.R", "R/zzz.R")) - attr(cov, which = "package") <- list(path = ".") # until https://github.com/r-lib/covr/issues/478 is solved + attr(cov, which = "package") <- list(path = "AMR") # until https://github.com/r-lib/covr/issues/478 is solved covr::codecov(cov, quiet = FALSE) shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 65aee617..ff5281d4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.6.0.9056 -Date: 2021-05-21 +Version: 1.6.0.9058 +Date: 2021-05-22 Title: Antimicrobial Resistance Data Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index b196d575..7e1e13fe 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# `AMR` 1.6.0.9056 -## Last updated: 21 May 2021 +# `AMR` 1.6.0.9058 +## Last updated: 22 May 2021 ### Breaking change * All antibiotic class selectors (such as `carbapenems()`, `aminoglycosides()`) can now be used for filtering as well, making all their accompanying `filter_*()` functions redundant (such as `filter_carbapenems()`, `filter_aminoglycosides()`). These functions are now deprecated and will be removed in a next release. diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 0ee14808..83595fab 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/data-raw/_install_deps.R b/data-raw/_install_deps.R index 846fd5e3..a783790a 100644 --- a/data-raw/_install_deps.R +++ b/data-raw/_install_deps.R @@ -25,17 +25,15 @@ # some old R instances have trouble installing tinytest, so we ship it too install.packages("data-raw/tinytest_1.2.4.patched.tar.gz") +install.packages("data-raw/AMR_latest.tar.gz", dependencies = FALSE) -descr <- readLines("AMR/DESCRIPTION") -pkg_suggests <- gsub(".*Suggests: (.*)*?[A-Z].*", "\\1", paste0(descr, "*", collapse = ""), perl = FALSE) -pkg_suggests <- unlist(strsplit(pkg_suggests, "[,* ]")) -pkg_suggests <- pkg_suggests[pkg_suggests != ""] +pkg_suggests <- gsub("[^a-zA-Z0-9]+", "", unlist(strsplit(packageDescription("AMR", fields = "Suggests"), ", ?"))) cat("Packages listed in Suggests:", paste(pkg_suggests, collapse = ", "), "\n") to_install <- pkg_suggests[!pkg_suggests %in% rownames(utils::installed.packages())] -to_update <- as.data.frame(utils::old.packages(repos = "https://cran.rstudio.com/"), stringsAsFactors = FALSE) -to_update <- to_update[which(to_update$Package %in% pkg_suggests), "Package", drop = TRUE] - +if (length(to_install) == 0) { + message("Nothing to install") +} for (i in seq_len(length(to_install))) { cat("Installing package", to_install[i], "\n") tryCatch(install.packages(to_install[i], repos = "https://cran.rstudio.com/", dependencies = TRUE, quiet = TRUE), @@ -44,6 +42,11 @@ for (i in seq_len(length(to_install))) { error = function(e) message(e$message)) } +to_update <- as.data.frame(utils::old.packages(repos = "https://cran.rstudio.com/"), stringsAsFactors = FALSE) +to_update <- to_update[which(to_update$Package %in% pkg_suggests), "Package", drop = TRUE] +if (length(to_update) == 0) { + message("Nothing to update") +} for (i in seq_len(length(to_update))) { cat("Updating package", to_update[i], "\n") tryCatch(update.packages(to_update[i], repos = "https://cran.rstudio.com/", ask = FALSE), diff --git a/docs/404.html b/docs/404.html index 0aac421f..59d99bde 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 35cf50ed..b9c388b0 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058 diff --git a/docs/articles/datasets.html b/docs/articles/datasets.html index 3c958f1e..473fffcc 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -39,7 +39,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058 @@ -192,7 +192,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 71994244..00a672e0 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058 diff --git a/docs/index.html b/docs/index.html index 341f0b57..2ab72e55 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058 diff --git a/docs/news/index.html b/docs/news/index.html index ec7eb7ec..6d2e74f2 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058 @@ -236,12 +236,12 @@ Source: NEWS.md -
-

- Unreleased AMR 1.6.0.9056

-
+
+

+ Unreleased AMR 1.6.0.9058

+

-Last updated: 21 May 2021 +Last updated: 22 May 2021

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index b5bf10ad..14230cba 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -12,7 +12,7 @@ articles: datasets: datasets.html resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html -last_built: 2021-05-21T18:27Z +last_built: 2021-05-22T06:56Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/index.html b/docs/reference/index.html index ab6fcd60..2012c6e5 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058

diff --git a/docs/survey.html b/docs/survey.html index 79119075..1ebc72cf 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ AMR (for R) - 1.6.0.9056 + 1.6.0.9058