-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
63 lines (53 loc) · 1.67 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
image: thomaschln/r-devtools
# gitlab-ci file inspired from https://www.r-bloggers.com/developing-r-packages-with-usethis-and-gitlab-ci-part-iii/
variables:
R_LIBS_DIR: "$CI_PROJECT_DIR/ci/lib"
CHECK_DIR: "$CI_PROJECT_DIR/ci/logs"
BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs/$CI_PROJECT_NAME.Rcheck"
cache:
paths:
- $R_LIBS_DIR
before_script:
- export R_LIBS_USER=$R_LIBS_DIR/$(R --version | sed -n 1p| sed -r 's/.*([0-9]\.[0-9]\.[0-9]).*/\1/')
- echo $R_LIBS_USER
- mkdir -p $R_LIBS_USER $BUILD_LOGS_DIR
- ls $R_LIBS_DIR
# delete other R version libs
- find $R_LIBS_DIR/* -maxdepth 0 ! -name $(basename $R_LIBS_USER) -type d -exec rm -r {} +
- ls $R_LIBS_DIR
- echo '.libPaths("'${R_LIBS_USER}'")' > .Rprofile
- apt-get update
- apt-get install -y qpdf pandoc git libcurl4-openssl-dev libgit2-dev libudunits2-dev libnetcdf-dev libproj-dev libgeos-dev libgdal-dev netcdf-bin
stages:
- deps
- check
- deploy
deps:
stage: deps
script:
- R -e 'remotes::install_cran("liquidSVM", repos="http://pnp.mathematik.uni-stuttgart.de/isa/steinwart/software/R", build_opts="--no-multiarch")'
- R -e 'remotes::install_deps(dependencies=T)'
only:
- master
- schedules
check:
stage: check
script:
- R -e 'devtools::check(check_dir = Sys.getenv("CHECK_DIR"), error_on = "error")'
- R -e 'devtools::install()'
only:
- master
- schedules
pages:
stage: deploy
script:
- R -e 'devtools::install_github("r-lib/pkgdown", upgrade="never")' # GITHUB_PAT necessary
- R -e 'devtools::document()'
- R -e 'pkgdown::build_site()'
# - grep gitlab docs/reference/PRO4SAIL.html
- mv docs public
artifacts:
paths:
- public
only:
- master