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

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

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

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

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

37
.check:
38
  stage: tests
39
  script:
40
  - 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")))'
41
42
43
  - R -e 'if (length(devtools::check_failures(path = Sys.getenv("BUILD_LOGS_DIR"), note = FALSE)) > 0) stop()'

.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