This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-11-06 16:08:58 +01:00
parent e2d05cb1b0
commit 1c4f91ab74
2 changed files with 32 additions and 29 deletions

View File

@ -23,11 +23,11 @@
# chck <- rhub::check(devtools::build(), platform = c('debian-clang-devel', 'debian-gcc-devel', 'fedora-clang-devel', 'fedora-gcc-devel', 'windows-x86_64-devel', 'debian-gcc-patched', 'solaris-x86-patched', 'debian-gcc-release', 'windows-x86_64-release', 'macos-elcapitan-release', 'windows-x86_64-oldrel'))
stages:
- build
- test
- deploy
- check
- lint
- test
- website
image: rocker/r-base
before_script:
@ -54,7 +54,7 @@ before_script:
- echo 'LANGUAGE="en_US.utf8"' > ~/.Renviron
R-release:
stage: build
stage: check
allow_failure: false
script:
- Rscript -e 'sessionInfo()'
@ -66,6 +66,7 @@ R-release:
# build package
- R CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- Rscript -e 'Sys.setenv(NOT_CRAN = "true")'
- R CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual --as-cran
artifacts:
when: always
@ -78,7 +79,7 @@ R-release:
- installed_deps/
R-devel:
stage: build
stage: check
image: rocker/r-devel
allow_failure: false
script:
@ -91,6 +92,7 @@ R-devel:
# build package
- Rdevel CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- Rscript -e 'Sys.setenv(NOT_CRAN = "true")'
- Rdevel CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual --as-cran
artifacts:
when: always
@ -102,8 +104,24 @@ R-devel:
paths:
- installed_deps/
coverage:
stage: test
lintr:
stage: lint
allow_failure: true
when: on_success
cache:
key: r350
paths:
- installed_deps/
policy: pull # no uploading after run
only:
- premaster
- master
script:
# check all syntax with lintr
- Rscript -e 'lintr::lint_package()'
codecovr:
stage: coverage
allow_failure: true
when: on_success
cache:
@ -122,7 +140,7 @@ coverage:
coverage: '/Code coverage: \d+\.\d+/'
pages:
stage: deploy
stage: website
when: always
only:
- master
@ -131,18 +149,3 @@ pages:
artifacts:
paths:
- public
lintr:
stage: lint
when: on_success
cache:
key: r350
paths:
- installed_deps/
policy: pull # no uploading after run
only:
- premaster
- master
script:
# check all syntax with lintr
- Rscript -e 'lintr::lint_package()'

View File

@ -130,7 +130,7 @@ test_that("mdro works", {
"S. aureus", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"S. aureus", "R", "R", "R", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"S. aureus", "S", "S", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"S. aureus", "R", "R", "I", "I", "I", "I", "I", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
"S. aureus", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
)
expect_equal(as.integer(mdro(stau)), c(1:4))
expect_s3_class(mdro(stau, verbose = TRUE), "data.frame")
@ -140,7 +140,7 @@ test_that("mdro works", {
"Enterococcus", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"Enterococcus", "R", "R", "R", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"Enterococcus", "S", "S", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"Enterococcus", "R", "R", "I", "I", "I", "I", "I", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
"Enterococcus", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
)
expect_equal(as.integer(mdro(ente)), c(1:4))
expect_s3_class(mdro(ente, verbose = TRUE), "data.frame")
@ -150,7 +150,7 @@ test_that("mdro works", {
"E. coli", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"E. coli", "R", "R", "R", "R", "R", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"E. coli", "S", "S", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"E. coli", "R", "R", "I", "I", "I", "I", "I", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
"E. coli", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
)
expect_equal(as.integer(mdro(entero)), c(1:4))
expect_s3_class(mdro(entero, verbose = TRUE), "data.frame")
@ -160,7 +160,7 @@ test_that("mdro works", {
"P. aeruginosa", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"P. aeruginosa", "R", "S", "S", "S", "R", "S", "S", "S", "R", "S", "S", "S", "S", "S", "S", "S", "S",
"P. aeruginosa", "S", "S", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"P. aeruginosa", "R", "R", "I", "I", "I", "I", "I", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
"P. aeruginosa", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
)
expect_equal(as.integer(mdro(pseud)), c(1:4))
expect_s3_class(mdro(pseud, verbose = TRUE), "data.frame")
@ -170,7 +170,7 @@ test_that("mdro works", {
"A. baumannii", "R", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S",
"A. baumannii", "R", "R", "R", "R", "S", "R", "S", "S", "S", "S", "S", "S", "S", "S", "R", "S", "S", "S", "S", "S", "S", "S",
"A. baumannii", "S", "S", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"A. baumannii", "R", "R", "I", "I", "I", "I", "I", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
"A. baumannii", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R"
)
expect_equal(as.integer(mdro(acin)), c(1:4))
expect_s3_class(mdro(acin, verbose = TRUE), "data.frame")