.gitlab-ci.yml 2.95 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"

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

16
.build:
17
18
19
20
  stage: build
  script:
    - cd ..
    - echo "setwd(\"$(pwd)\")" > .Rprofile
21
    - R -e 'Sys.getenv()'
22
    - R -e '.libPaths()'
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 ' rcmdcheck::rcmdcheck(args = ifelse(as.logical(Sys.getenv("NOT_CRAN")), "", "--as-cran"), error_on = "warning")'
42
43

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

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

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

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

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

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

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

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

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

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

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

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

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

check_as_cran_oldrel:
135
  only:
136
137
138
139
140
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "oldrel"
141
  extends: .check_as_cran
Dorchies David's avatar
Dorchies David committed
142
143
144

revdepcheck_patched:
  stage: revdepcheck
145
146
147
148
  only:
    refs:
      - tags
      - schedules
Dorchies David's avatar
Dorchies David committed
149
150
151
152
153
154
  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()'
155
156
157
158
159
160
  artifacts:
    paths:
      - revdep/README.md
      - revdep/problems.md
      - revdep/failures.md
      - revdep/cran.md