This repository has been archived by the owner on Jul 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
128 lines (119 loc) · 3.73 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
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: "mlr3learners.lightgbm"
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
- apt-get update && apt-get -y --no-install-recommends install cmake
- git clone --recursive https://github.com/microsoft/LightGBM
- cd LightGBM && Rscript build_r.R
- R -e "devtools::install(pkg = '.', upgrade = 'always')"
- 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_deps(pkg = '.', upgrade = 'always')" # we only need dev_deps for the vignette and testing
- R -e "devtools::install(pkg = '.', upgrade = 'alway')"
except:
refs:
- tags
only:
refs:
- master
build_vignettes:
stage: deploy
script:
- R -e "devtools::install_dev_deps(pkg = '.', upgrade = 'always')" # we only need dev_deps for the vignette and testing
- apt-get update && apt-get -y --no-install-recommends install cmake
- git clone --recursive https://github.com/microsoft/LightGBM
- cd LightGBM && Rscript build_r.R
- R -e "devtools::build_vignettes(pkg = '.', clean = FALSE)"
#after_script:
# - git config --global user.name "${GITHUB_USER}"
# - git config --global user.email "${GITHUB_USER_EMAIL}"
# - git clone https://${GITHUB_USER}:${K8S_SECRET_GITHUB_ACCESS_TOKEN}@github.com/${GITHUB_USER}/${GITHUB_USER}.github.io
# - mv doc/*.md ${GITHUB_USER}.github.io/${R_PKG_NAME}/
# - mv vignettes/png/*.png ${GITHUB_USER}.github.io/png/
# - cd ${GITHUB_USER}.github.io/
# - git add .
# - git commit -m "Deploy to Github Pages from ${CI_PROJECT_DIR}"
# - git push
except:
refs:
- tags
only:
refs:
- master
changes:
- "vignettes/*.Rmd"