-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
153 lines (140 loc) · 4.27 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
image: rocker/geospatial:4.0.1
variables:
R_LIBS_USER: "ci/lib"
cache:
key: global-cache
paths:
- ci/lib/
stages:
- build
- test
- pkgdown
- pkgdown-move
- deploy
building:
stage: build
script:
- mkdir -p $R_LIBS_USER
# - apt update -qq && apt install -y libgdal-dev libproj-dev libgeos-dev libudunits2-dev libnode-dev libcairo2-dev libnetcdf-dev libharfbuzz-dev libfribidi-dev
- apt-get update -qq && apt-get install -y libharfbuzz-dev libfribidi-dev
- Rscript -e 'source("renv/activate.R")'
- Rscript -e 'renv::restore()'
- Rscript -e 'install.packages("pacman")'
- Rscript -e 'pacman::p_load("remotes");install_local()'
- Rscript -e 'pacman::p_load("devtools");check()'
# To have the coverage percentage appear as a gitlab badge follow these
# instructions:
# https://docs.gitlab.com/ee/user/project/pipelines/settings.html#test-coverage-parsing
# The coverage parsing string is
# Coverage: \d+\.\d+
coverage:
stage: test
allow_failure: true
when: on_success
only:
- main
- dev
- test-ci
script:
- Rscript -e 'install.packages("pacman")'
- Rscript -e 'source("renv/activate.R")'
- Rscript -e 'renv::restore()'
- Rscript -e 'pacman::p_load("remotes");install_local()'
- Rscript -e 'pacman::p_load("covr");gitlab(quiet = FALSE)'
artifacts:
paths:
- public
expire_in: 30 days
# To produce a code coverage report as a GitLab page see
# https://about.gitlab.com/2016/11/03/publish-code-coverage-report-with-gitlab-pages/
integration:
stage: pkgdown
allow_failure: true
when: on_success
only:
- main
- dev
- test-ci
script:
- Rscript -e 'install.packages("pacman")'
- Rscript -e 'source("renv/activate.R")'
- Rscript -e 'renv::restore()'
- Rscript -e 'pacman::p_load("remotes");install_local()'
- Rscript -e 'pacman::p_load("covr");gitlab(quiet = FALSE)'
- Rscript -e 'pacman::p_load("remotes");install_github("ThinkR-open/thinkrtemplate")'
- Rscript -e 'pacman::p_load("remotes");install_local()'
- Rscript -e 'pacman::p_load("pkgdown");build_site()'
artifacts:
paths:
- docs
expire_in: 30 days
integration-test:
stage: pkgdown-move
dependencies:
- integration
only:
- test-ci
script:
- mkdir -p public/test
- wget https://gitlab.irstea.fr/diades/diades.atlas/-/jobs/artifacts/master/download?job=pages &&
unzip -o download?job=pages &&
rm download?job=pages &&
echo "copied master artifacts" ||
echo "copied master artifacts failed"
- wget https://gitlab.irstea.fr/diades/diades.atlas/-/jobs/artifacts/dev/download?job=pages &&
unzip -o download?job=pages &&
rm download?job=pages &&
echo "copied dev artifacts" ||
echo "copied dev artifacts failed"
- cp -r docs/* public/test
artifacts:
paths:
- public
expire_in: 30 days
integration-dev:
stage: pkgdown-move
dependencies:
- integration
only:
- dev
script:
- mkdir -p public/dev
- wget https://gitlab.irstea.fr/diades/diades.atlas/-/jobs/artifacts/master/download?job=pages &&
unzip -o download?job=pages &&
rm download?job=pages &&
echo "copied master artifacts" ||
echo "copied master artifacts failed"
- cp -r docs/* public/dev
artifacts:
paths:
- public
expire_in: 30 days
integration-master:
stage: pkgdown-move
dependencies:
- integration
only:
- main
script:
- mkdir -p public
- wget https://gitlab.irstea.fr/diades/diades.atlas/-/jobs/artifacts/dev/download?job=pages &&
unzip -o download?job=pages &&
rm download?job=pages &&
echo "copied dev artifacts" ||
echo "copied dev artifacts failed"
- cp -r docs/* public
artifacts:
paths:
- public
expire_in: 30 days
pages:
stage: deploy
script:
- echo "deployment with cache ?"
artifacts:
paths:
- public
only:
- main
- dev
- test-ci