blob: 6e46c8b2c118920711a46381bec3e54ab49d69d8 [file] [log] [blame]
Marc Kupietz16e66c32024-01-28 13:31:25 +01001.install-rkorapclient:
2 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"
12 # Enable caching for `apt-get`.
13 APT_CACHE_DIR: ${CI_PROJECT_DIR}/apt-cache
14 # Export `noninteractive` frontend to prevent requesting user input
15 DEBIAN_FRONTEND: noninteractive
16 R_LIBS_USER: ${CI_PROJECT_DIR}/rlib
17
18 cache:
19 key: rkorapclient
20 paths:
21 - apt-cache/
22 - ccache/
23 - rlib/
24
25 before_script:
26 - source ./ci/section_helper.sh
27
28 - 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 - apt-get update
37 - apt-get install -y -o dir::cache::archives="$APT_CACHE_DIR" --no-install-recommends software-properties-common dirmngr ccache wget
Marc Kupietzca5fe5a2025-02-20 10:37:15 +010038# - wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
39# - add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
Marc Kupietz16e66c32024-01-28 13:31:25 +010040 # - add-apt-repository ppa:c2d4u.team/c2d4u4.0+
41 - grep "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
42 - ln -s $(which ccache) /usr/local/sbin/gcc
43 - ln -s $(which ccache) /usr/local/sbin/g++
44 - end_section install_linux_packages
45
46 script:
Marc Kupietzca5fe5a2025-02-20 10:37:15 +010047 - start_section installing "Installing RKorAPClient from source"
Marc Kupietz16e66c32024-01-28 13:31:25 +010048 - export PATH=/usr/local/sbin:$PATH
Marc Kupietz943da992025-04-06 16:14:59 +020049 - R -q -e "install.packages('pak', dependencies=TRUE)"
Marc Kupietzb8766592025-04-06 16:28:40 +020050 - R -q -e "pak::pak('ggplot2', 'RKorAPClient', dependencies=TRUE)"
Marc Kupietzca5fe5a2025-02-20 10:37:15 +010051 - end_section installing
Marc Kupietz943da992025-04-06 16:14:59 +020052 - start_section linstalling "Installing RKorAPClient from source"
53 - R -q -e 'pak::pak(".")'
54 - ccache -s
55 - end_section linstalling
56