.gitlab-ci.yml 3.08 KB
Newer Older
1
2
stages:
  - build
Dorchies David's avatar
Dorchies David committed
3
  - check
4
  - regression
Dorchies David's avatar
Dorchies David committed
5
  - revdepcheck
6

7
8
9
variables:
  R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib"
  CHECK_DIR: "$CI_PROJECT_DIR/ci/logs"
10
  BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs/airGR.Rcheck"
11

12
13
14
default:
  before_script:
    - echo "setwd(\"$(pwd)\")" > .Rprofile
15
    - PATH=~/R/sources/R-${R_VERSION}/bin:$PATH
16
    - rename "s/${R_VERSION}.airGR/airGR/" *.tar.gz
17

18
.build:
19
20
21
22
  stage: build
  script:
    - cd ..
    - echo "setwd(\"$(pwd)\")" > .Rprofile
23
    - R -e 'utils::install.packages("usethis", repo = "https://cloud.r-project.org/")'
24
    - R -e 'remotes::install_deps(pkgdir = "airgr", dep = T)'
25
    - R CMD build airgr
26
27
28
29
  artifacts:
    untracked: true
    expire_in: 1 week

30
31
32
.regression:
  stage: regression
  script:
33
34
35
36
    - Rscript tests/testthat/regression_tests.R stable
    - R CMD INSTALL .
    - Rscript tests/testthat/regression_tests.R dev
    - Rscript tests/testthat/regression_tests.R compare
37

38
.check:
Dorchies David's avatar
Dorchies David committed
39
  stage: check
40
  script:
41
  - R -e 'devtools::check(check_dir = Sys.getenv("CHECK_DIR"), cran = !as.logical(Sys.getenv("NOT_CRAN")), env_vars = c(NOT_CRAN = Sys.getenv("NOT_CRAN")))'
42
43
44
  - R -e 'if (length(devtools::check_failures(path = Sys.getenv("BUILD_LOGS_DIR"), note = FALSE)) > 0) stop()'

.check_not_cran:
45
46
  variables:
    NOT_CRAN: "true"
47
  extends: .check
48

49
.check_as_cran:
50
51
52
  variables:
    NOT_CRAN: "false"
  extends: .check
53
54
55
56
57
58

build_patched:
  variables:
    R_VERSION: "patched"
  extends: .build

59
60
61
62
63
64
regression_patched:
  variables:
    R_VERSION: "patched"
  extends: .regression

regression_devel:
65
66
67
  only:
    refs:
      - schedules
68
69
70
71
72
  variables:
    R_VERSION: "devel"
  extends: .regression

regression_oldrel:
73
74
75
  only:
    refs:
      - schedules
76
77
78
79
  variables:
    R_VERSION: "oldrel"
  extends: .regression

80
81
82
check_not_cran_patched:
  variables:
    R_VERSION: "patched"
83
  extends: .check_not_cran
84
85
86
87

check_as_cran_patched:
  variables:
    R_VERSION: "patched"
88
  extends: .check_as_cran
89
90
91
92
93
94
95
96
97
98
99

build_devel:
  only:
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "devel"
  extends: .build

check_not_cran_devel:
100
  only:
101
102
103
104
105
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "devel"
106
  extends: .check_not_cran
107
108

check_as_cran_devel:
109
  only:
110
111
112
113
114
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "devel"
115
  extends: .check_as_cran
116
117
118
119
120
121
122
123
124
125
126

build_oldrel:
  only:
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "oldrel"
  extends: .build

check_not_cran_oldrel:
127
  only:
128
129
130
131
132
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "oldrel"
133
  extends: .check_not_cran
134
135

check_as_cran_oldrel:
136
  only:
137
138
139
140
141
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "oldrel"
142
  extends: .check_as_cran
Dorchies David's avatar
Dorchies David committed
143
144
145
146
147
148
149
150
151

revdepcheck_patched:
  stage: revdepcheck
  variables:
    R_VERSION: "patched"
  script:
    - R -e 'remotes::install_github("https://github.com/r-lib/revdepcheck")'
    - R -e 'revdepcheck::revdep_check(num_workers = 2)'
    - R -e 'if (any(sapply(revdepcheck::revdep_summary(), function(x) {any(x$cmp$change == 1)}))) stop()'
152
153
154
155
156
157
  artifacts:
    paths:
      - revdep/README.md
      - revdep/problems.md
      - revdep/failures.md
      - revdep/cran.md