-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
97 lines (89 loc) · 2.48 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
variables:
_R_CHECK_CRAN_INCOMING_: "false"
_R_CHECK_FORCE_SUGGESTS_: "true"
CI_IMAGE_NAME: "rocker/verse"
CI_IMAGE_TAG: "4.0.0"
R_PKG_NAME: "labvisualizer"
default:
image: ${CI_IMAGE_NAME}:${CI_IMAGE_TAG}
before_script:
- echo "options('repos' = 'https://cloud.r-project.org/')" >> /etc/R/Rprofile.site
- mkdir -p ci
stages:
- build
- deploy
check:
stage: build
allow_failure: true # necessary when having development-packages (in remotes-section of DESCRIPTION)
script:
- R -e "devtools::install_dev_deps(pkg = '.', upgrade = 'always')"
- R -e "rcmdcheck::rcmdcheck(path = '.', args = c('--no-tests', '--no-vignettes', '--as-cran'), build_args = c('--no-build-vignettes'), check_dir = '${CI_PROJECT_DIR}/ci')"
artifacts:
paths:
- "${CI_PROJECT_DIR}/ci/*.Rcheck"
when: on_failure # upload check artifacts when job fails!
expire_in: 1 week
except:
refs:
- tags
only:
refs:
- master
- development
create_manual:
stage: build
allow_failure: true
script:
- R -e "devtools::install_deps(pkg = '.', upgrade = 'always')"
- R -e "devtools::build_manual(pkg = '.', path = '${CI_PROJECT_DIR}/ci')"
artifacts:
paths:
- "${CI_PROJECT_DIR}/ci/*.pdf"
expire_in: 1 week
except:
refs:
- tags
only:
refs:
- master
build_source_and_binary:
stage: build
script:
- R -e "devtools::install_deps(pkg = '.', upgrade = 'always')"
- R -e "devtools::build(pkg = '.', path = '${CI_PROJECT_DIR}/ci', binary = FALSE, vignettes = FALSE)"
- R -e "devtools::build(pkg = '.', path = '${CI_PROJECT_DIR}/ci', binary = TRUE, vignettes = FALSE)"
artifacts:
paths:
- "${CI_PROJECT_DIR}/ci/*.tar.gz"
expire_in: 1 week
except:
refs:
- tags
only:
refs:
- master
testing:
stage: build
script:
- R -e "devtools::install_dev_deps(pkg = '.', upgrade = 'always')" # we only need dev_deps for the vignette and testing
- R -e "devtools::test(pkg = '.')"
except:
refs:
- tags
only:
refs:
- master
- development
# 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/
install:
stage: deploy
script:
- R -e "devtools::install_dev_deps(pkg = '.', upgrade = 'always')" # we only need dev_deps for the vignette and testing
- R -e "devtools::install(pkg = '.', upgrade = 'always')"
except:
refs:
- tags
only:
refs:
- master