.gitlab-ci.yml 1.02 KB
Newer Older
Pradat Yoann's avatar
Pradat Yoann committed
1 2
stages:
  - check
Pradat Yoann's avatar
Pradat Yoann committed
3 4
  - test
  - install
Pradat Yoann's avatar
Pradat Yoann committed
5

6 7 8 9
default:
  tags:
    - docker

Pradat Yoann's avatar
Pradat Yoann committed
10
variables:
Pradat Yoann's avatar
Pradat Yoann committed
11
  RENV_PATHS_ROOT: "/opt/r_renv"
Pradat Yoann's avatar
Pradat Yoann committed
12 13
  CODECOV_TOKEN: "b524d434-9189-48fc-a919-72e40de8cd22"

Pradat Yoann's avatar
Pradat Yoann committed
14 15 16
before_script:
  - Rscript -e 'renv::restore()'

Pradat Yoann's avatar
Pradat Yoann committed
17 18
check:
  stage: check
Pradat Yoann's avatar
Pradat Yoann committed
19 20 21
  image: gitlab-research.centralesupelec.fr:4567/2019pradaty/tableextra_docker
  script:
    - Rscript -e 'if (!identical(devtools::check(document = FALSE, args = "--no-tests")[["errors"]], character(0))) stop("Check with Errors")'
Pradat Yoann's avatar
Pradat Yoann committed
22 23 24
  only:
    refs:
      - master
Pradat Yoann's avatar
Pradat Yoann committed
25 26 27 28 29 30

test: 
  stage: test
  image: gitlab-research.centralesupelec.fr:4567/2019pradaty/tableextra_docker
  script:
    - Rscript -e 'if (any(as.data.frame(devtools::test())[["failed"]] > 0)) stop("Some tests failed.")'
Pradat Yoann's avatar
Pradat Yoann committed
31
    - Rscript -e 'covr::codecov(token="${CODECOV_TOKEN}")'
Pradat Yoann's avatar
Pradat Yoann committed
32 33 34
  only:
    refs:
      - master
Pradat Yoann's avatar
Pradat Yoann committed
35 36 37 38

install:
  stage: check
  image: gitlab-research.centralesupelec.fr:4567/2019pradaty/tableextra_docker
Pradat Yoann's avatar
Pradat Yoann committed
39
  script:
Pradat Yoann's avatar
Pradat Yoann committed
40 41
    - Rscript -e 'devtools::build(binary=T)'
    - Rscript -e 'devtools::install()'
Pradat Yoann's avatar
Pradat Yoann committed
42 43 44
  only:
    refs:
      - master