.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

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

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

34
35
.regression:
  stage: regression
36
37
38
39
40
#  only:
#    refs:
#      - schedules
  variables:
    NOT_CRAN: "true"
41
42
43
44
  script:
    - Rscript -e 'source("tests/testthat/store_examples.R"); StoreRefExampleResults("airGR");'
    - R CMD INSTALL .
    - Rscript -e 'source("tests/testthat/store_examples.R"); StoreTestExampleResults("airGR");'
45
    - Rscript -e 'res <- testthat::test_file("tests/testthat/test-regression.R"); dRes = as.data.frame(res); if(any(dRes[,"failed"]>0) | any(dRes[,"error"])) {quit(status = 1)};'
46

47
.check_not_cran:
48
  stage: tests
49
50
  variables:
    NOT_CRAN: "true"
51
  script:
52
    - R CMD check airGR_*.tar.gz
53

54
.check_as_cran:
55
56
  stage: tests
  script:
57
    - R CMD check --as-cran airGR_*.tar.gz
58

59
60
61
62
update_packages_patched:
  variables:
    R_VERSION: "patched"
  extends: .update_packages
63

64
65
66
67
68
build_patched:
  variables:
    R_VERSION: "patched"
  extends: .build

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
regression_patched:
  variables:
    R_VERSION: "patched"
  extends: .regression

regression_devel:
  variables:
    R_VERSION: "devel"
  extends: .regression

regression_oldrel:
  variables:
    R_VERSION: "oldrel"
  extends: .regression

84
85
86
check_not_cran_patched:
  variables:
    R_VERSION: "patched"
87
  extends: .check_not_cran
88
89
90
91

check_as_cran_patched:
  variables:
    R_VERSION: "patched"
92
  extends: .check_as_cran
93

94
95
96
97
98
update_packages_devel:
  variables:
    R_VERSION: "devel"
  extends: .update_packages

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

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

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

126
127
128
129
130
update_packages_oldrel:
  variables:
    R_VERSION: "oldrel"
  extends: .update_packages

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

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

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