-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
92 lines (82 loc) · 2.99 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
image: rocker/r-ver:4.4.0
stages:
- build
- document
- check
- sonar
- publish
- deploy
variables:
APT_DEPS: "git libssl-dev libcurl4-openssl-dev libcurl4-openssl-dev libssl-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev git libxml2-dev libfontconfig1-dev libgit2-dev libssl-dev pandoc libicu-dev libz-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libtiff-dev make zlib1g-dev git libgit2-dev libssl-dev libcurl4-openssl-dev git libicu-dev pandoc make make zlib1g-dev libssl-dev libcurl4-openssl-dev pandoc libssl-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libxml2-dev libfontconfig1-dev libssl-dev pandoc libicu-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libtiff-dev make libfreetype6-dev libfribidi-dev libharfbuzz-dev libfontconfig1-dev libjpeg-dev libpng-dev libtiff-dev libxml2-dev libicu-dev pandoc make libxml2-dev libcurl4-openssl-dev libssl-dev libicu-dev libfontconfig1-dev libfreetype6-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libfontconfig1-dev git libgit2-dev libssl-dev libcurl4-openssl-dev make libxml2-dev"
IMAGE: dockerhub.sbgenomics.com/$CI_PROJECT_NAME
RENV_PATHS_CACHE: ${CI_PROJECT_DIR}/cache
RENV_PATHS_LIBRARY: ${CI_PROJECT_DIR}/renv/library
RENV_CONFIG_REPOS_OVERRIDE: http://cran.r-project.org
LIBRARY_NAME: examplePackage
cache:
key: $CI_JOB_NAME
paths:
- ${RENV_PATHS_CACHE}
- ${RENV_PATHS_LIBRARY}
before_script:
- mkdir -p ${RENV_PATHS_CACHE} ${RENV_PATHS_LIBRARY}
- apt-get -qq update;
- apt-get -y install ${APT_DEPS}
- apt-get install -y nodejs
- apt-get install -y npm
- R -e "install.packages(c('remotes', 'devtools', 'covr'), repos = 'http://cran.r-project.org')"
- R -e "if (!requireNamespace('renv', quietly = TRUE)) remotes::install_version('renv', version = '1.0.7')"
- R -e "renv::restore(lockfile = 'renv.lock')"
buildbinary:
stage: build
script:
- R -e 'devtools::build(binary = TRUE, vignettes = FALSE)'
documentation:
stage: document
script:
- R -e 'devtools::document()'
lintr:
stage: check
script:
# redirect lintr stdout and stderr to file
- R -e "install.packages('lintr')"
- CI="" Rscript -e "lintr::lint_package()" &> lint_output.txt
# fail if file is not empty
- if [ -s "lint_output.txt" ]; then exit 1; fi
artifacts:
when: on_failure
paths:
- lint_output.txt
coverage:
stage: check
rules:
- when: always
script:
- Rscript -e "devtools::install(dependencies = FALSE)"
- Rscript run_cov.R
artifacts:
paths:
- covr_sonarqube.xml
sonar:
stage: sonar
dependencies:
- coverage
image: emeraldsquad/sonar-scanner:2.2.0
before_script: []
script:
- infinity sonar scanner
allow_failure: true
only:
- merge_requests
- master
- develop
pages:
stage: deploy
script:
- apt-get update && apt-get install -y pandoc
- R -e 'devtools::build(binary = TRUE, vignettes = FALSE)'
- R -e "install.packages('pkgdown')"
- R -e "pkgdown::build_site()"
artifacts:
paths:
- public