blob: 1ef0245b0c40813e331f56090ccd6c0ecca2cb78 [file] [log] [blame]
Marc Kupietz1f5969c2023-05-27 11:36:08 +02001# use the verse rocker image, as it contains tidyverse, devtools and some texlive
2image: rocker/verse
3
4# define stages of runner. at the moment,
5# just build (no test or deploy).
6stages:
7 - build
8
9build-job:
10 stage: build
11
12 cache:
13 key: icc
14 paths:
15 - ./cache
16
17 artifacts:
18 paths:
19 - "target/*"
20
21 before_script:
22 - source `find .. -name section_helper.sh`
23
24 - start_section install_linux_packages "Installing missing Linux packages"
25 - apt-get update
Marc Kupietze0730342023-06-14 09:52:17 +020026 - apt-get install -y build-essential libglpk40 libcurl4-gnutls-dev libxml2-dev libsodium-dev libsecret-1-dev libfontconfig1-dev libssl-dev libxt6 libpq-dev imagemagick ghostscript software-properties-common
27 - add-apt-repository ppa:saiarcot895/chromium-beta
28 - apt update
29 - apt install -y chromium-browser
30 - chromium-browser --no-sandbox --headless --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf https://www.ids-mannheim.de/
Marc Kupietz1f5969c2023-05-27 11:36:08 +020031 - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8
32
33 - end_section install_linux_packages
34
35 - start_section install_fonts "Installing Libertinus and Fira fonts"
36 - wget -O- https://github.com/mozilla/Fira/archive/refs/tags/4.202.tar.gz | tar -C /usr/share/fonts -zx --wildcards "*.otf"
37 - fc-cache
38 - end_section install_fonts
39
40 - start_section install_r_packages "Installing missing R packages"
Marc Kupietz6e21b102023-06-02 18:04:04 +020041 - R -e "install.packages(c('RKorAPClient', 'httr', 'tidytext', 'httpuv', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite'))"
Marc Kupietz1f5969c2023-05-27 11:36:08 +020042 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
Marc Kupietz96c3af32023-06-14 07:31:46 +020043 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/posterdown")'
Marc Kupietz1f5969c2023-05-27 11:36:08 +020044 - end_section install_r_packages
45
46 script:
47 - start_section render "Running scripts"
Marc Kupietz6e21b102023-06-02 18:04:04 +020048 - R_CACHE_ROOTPATH=./cache R -f ./R/icc_stats.R
49 - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('R/report.Rmd', output_format='html_document', output_dir='target')"
Marc Kupietz96c3af32023-06-14 07:31:46 +020050 - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('R/poster.Rmd', output_format='posterdown::posterdown_ids', output_dir='target')"
Marc Kupietze0730342023-06-14 09:52:17 +020051 - ./ci/html2pdf target/poster.html target/poster.pdf 1
Marc Kupietz1f5969c2023-05-27 11:36:08 +020052 - end_section render
53