Skip to content

Commit 3ae6b2c

Browse files
committed
gitlab-ci: switch to rocker/tidyverse and to pak for install R packages
Ubuntu-stable R version is outdated Change-Id: Ie454d6c3c26bf27ffa5d0de09ec49fb45ed0874f
1 parent e29dec0 commit 3ae6b2c

File tree

2 files changed

+12
-43
lines changed

2 files changed

+12
-43
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
include:
22
local: ci/install-rkorapclient-ci.yml
33

4-
test-korapclient-on-latest:
4+
test-korapclient:
55
extends: .install-rkorapclient
6-
image: ubuntu:latest
6+
image: rocker/tidyverse
77
cache:
8-
key: rkorapclient-ubuntu-stable
8+
key: pykorapclient
99
paths:
1010
- apt-cache/
11-
- ccache/
12-
- rlib/
11+
1312
script:
1413
- mkdir -p ~/.config/pip
15-
- echo -e "[global]\nbreak-system-packages = true" >> ~/.config/pip/pip.conf
14+
- echo -e "[global]\nbreak-system-packages = true" >> ~/.config/pip/pip.conf
15+
- python3 -m pip install pytest
1616
- python3 -m pip install .
1717
- python3 -m pytest -v
18-

ci/install-rkorapclient-ci.yml

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,24 @@
11
.install-rkorapclient:
22
variables:
3-
# Set `CCACHE_BASEDIR` and `CCACHE_DIR` to point `ccache` towards the cached
4-
# path on the gitlab-runner. This enables to cache the output of `ccache`
5-
# between various runs.
6-
CCACHE_BASEDIR: ${CI_PROJECT_DIR}
7-
CCACHE_DIR: ${CI_PROJECT_DIR}/ccache
8-
# Set `ccache` to `content` to prevent rebuilding of the CI/CD containers to
9-
# trigger a recreate of the cache. By using `content` the compiler's `mtime`
10-
# is not considered as part of the hash.
11-
CCACHE_COMPILERCHECK: "content"
123
# Enable caching for `apt-get`.
134
APT_CACHE_DIR: ${CI_PROJECT_DIR}/apt-cache
145
# Export `noninteractive` frontend to prevent requesting user input
156
DEBIAN_FRONTEND: noninteractive
16-
R_LIBS_USER: ${CI_PROJECT_DIR}/rlib
177

188
cache:
19-
key: rkorapclient
9+
key: pykorapclient
2010
paths:
2111
- apt-cache/
22-
- ccache/
23-
- rlib/
2412

2513
before_script:
2614
- source ./ci/section_helper.sh
2715

2816
- start_section install_linux_packages "Installing missing Linux packages"
29-
- mkdir -pv $APT_CACHE_DIR ccache $R_LIBS_USER /usr/local/sbin ~/.ccache ~/.R
30-
- cp ci/Makevars ~/.R/Makevars
31-
- cp ci/ccache.conf ${CI_PROJECT_DIR}/ccache/ccache.conf
32-
- cp ci/ccache.conf ~/.ccache/ccache.conf
33-
- echo "R_LIBS='$R_LIBS_USER'" > .Renviron
34-
- echo "MAKEFLAGS=-j$(nproc)" >> ~/.R/Makevars
35-
- echo "MAKE=make -j$(nproc)" >> ~/.R/Makevars
36-
- echo "CFLAGS+=-Wno-error=format-security" >> ~/.R/Makevars
37-
- echo "CCFLAGS+=-Wformat=0" >> ~/.R/Makevars
17+
- mkdir -p $APT_CACHE_DIR
3818
- apt-get update
39-
- apt-get install -y -o dir::cache::archives="$APT_CACHE_DIR" --no-install-recommends software-properties-common dirmngr ccache wget python3-pip libdeflate-dev
40-
- wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
41-
- add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
42-
- add-apt-repository -y ppa:c2d4u.team/c2d4u4.0+
43-
- grep -E "sudo apt.* install" Readme.md | sed -e 's/.*sudo apt.* install/apt-get install --no-install-recommends -o dir::cache::archives="$APT_CACHE_DIR" -y libharfbuzz-dev libfribidi-dev /g' | sh
44-
- apt-get install -y -o dir::cache::archives="$APT_CACHE_DIR" r-cran-ggplot2 r-cran-broom R.cache r-cran-tibble r-cran-magrittr r-cran-tidyr r-cran-dplyr r-cran-lubridate r-cran-jsonlite r-cran-keyring r-cran-httr r-cran-curl r-cran-purrr r-cran-stringr r-cran-urltools r-cran-remotes
45-
- ln -s $(which ccache) /usr/local/sbin/gcc
46-
- ln -s $(which ccache) /usr/local/sbin/g++
47-
- end_section install_linux_packages
48-
- start_section installing "Installing RKorAPClient from CRAN"
19+
- apt-get install -y -o dir::cache::archives="$APT_CACHE_DIR" python3-pip
20+
- start_section installing "Installing RKorAPClient package"
4921
- export PATH=/usr/local/sbin:$PATH
50-
# - export RENV_CONFIG_REPOS_OVERRIDE=https://packagemanager.posit.co/cran/__linux__/$(lsb_release --short --codename)/latest
51-
# - echo "options(repos = c(CRAN = \"$RENV_CONFIG_REPOS_OVERRIDE\"))" >> ~/.Rprofile
52-
- R -q -e "install.packages(c('RKorAPClient'), dependencies = TRUE)"
22+
- R -q -e "install.packages('pak')"
23+
- R -q -e "pak::pak('RKorAPClient')"
5324
- end_section installing
54-
script:

0 commit comments

Comments
 (0)