.gitlab-ci.yml 2.84 KB
Newer Older
1
stages:
2
  - update_packages
3
  - build
4
  - regression
5
6
  - tests

7
8
9
default:
  before_script:
    - echo "setwd(\"$(pwd)\")" > .Rprofile
10
    - PATH=~/R/sources/R-${R_VERSION}/bin:$PATH
11
    - rename "s/${R_VERSION}.airGR/airGR/" *.tar.gz
12
    - R -e 'chooseCRANmirror(graphics = FALSE, ind = 1); pkg <- "CaRamel"; pkgInst <- installed.packages()[, "Package"]; pkgMiss <- setdiff(pkg, pkgInst); if (length(pkgMiss) > 0) install.packages(pkgMiss)'
13

14
15
16
17
18
19
20
21
22
.update_packages:
  stage: update_packages
  only:
    refs:
      - tags
      - schedules
  script:
    - Rscript -e "update.packages(ask=FALSE, repos=\"http://cran.r-project.org\")"

23
.build:
24
25
26
27
  stage: build
  script:
    - cd ..
    - echo "setwd(\"$(pwd)\")" > .Rprofile
28
    - R CMD build airgr
29
    - rename "s/airGR/${R_VERSION}.airGR/" airGR_*.tar.gz
30
31
32
33
34
    - mv *.tar.gz airgr/
  artifacts:
    untracked: true
    expire_in: 1 week

35
36
37
.regression:
  stage: regression
  script:
38
39
40
41
    - Rscript tests/testthat/regression_tests.R stable
    - R CMD INSTALL .
    - Rscript tests/testthat/regression_tests.R dev
    - Rscript tests/testthat/regression_tests.R compare
42

43
.check_not_cran:
44
  stage: tests
45
46
  variables:
    NOT_CRAN: "true"
47
  script:
48
    - R CMD check airGR_*.tar.gz
49

50
.check_as_cran:
51
52
  stage: tests
  script:
53
    - R CMD check --as-cran airGR_*.tar.gz
54

55
56
57
58
update_packages_patched:
  variables:
    R_VERSION: "patched"
  extends: .update_packages
59

60
61
62
63
64
build_patched:
  variables:
    R_VERSION: "patched"
  extends: .build

65
66
67
68
69
70
regression_patched:
  variables:
    R_VERSION: "patched"
  extends: .regression

regression_devel:
71
72
73
  only:
    refs:
      - schedules
74
75
76
77
78
  variables:
    R_VERSION: "devel"
  extends: .regression

regression_oldrel:
79
80
81
  only:
    refs:
      - schedules
82
83
84
85
  variables:
    R_VERSION: "oldrel"
  extends: .regression

86
87
88
check_not_cran_patched:
  variables:
    R_VERSION: "patched"
89
  extends: .check_not_cran
90
91
92
93

check_as_cran_patched:
  variables:
    R_VERSION: "patched"
94
  extends: .check_as_cran
95

96
97
98
99
100
update_packages_devel:
  variables:
    R_VERSION: "devel"
  extends: .update_packages

101
102
103
104
105
106
107
108
109
110
build_devel:
  only:
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "devel"
  extends: .build

check_not_cran_devel:
111
  only:
112
113
114
115
116
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "devel"
117
  extends: .check_not_cran
118
119

check_as_cran_devel:
120
  only:
121
122
123
124
125
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "devel"
126
  extends: .check_as_cran
127

128
129
130
131
132
update_packages_oldrel:
  variables:
    R_VERSION: "oldrel"
  extends: .update_packages

133
134
135
136
137
138
139
140
141
142
build_oldrel:
  only:
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "oldrel"
  extends: .build

check_not_cran_oldrel:
143
  only:
144
145
146
147
148
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "oldrel"
149
  extends: .check_not_cran
150
151

check_as_cran_oldrel:
152
  only:
153
154
155
156
157
    refs:
      - tags
      - schedules
  variables:
    R_VERSION: "oldrel"
158
  extends: .check_as_cran
159