blob: a13f384456b6c73d993688145dfedb2f75ff0c10 [file] [log] [blame]
Marc Kupietz1f5969c2023-05-27 11:36:08 +02001# use the verse rocker image, as it contains tidyverse, devtools and some texlive
Marc Kupietz703a4e62023-06-16 15:12:25 +02002image: rocker/tidyverse
Marc Kupietz1f5969c2023-05-27 11:36:08 +02003
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 Kupietz533ad562023-06-26 21:29:03 +020026 - apt-get install -y libvulkan1 libu2f-udev fonts-liberation build-essential libglpk40 libcurl4-gnutls-dev libxml2-dev libsodium-dev libsecret-1-dev libfontconfig1-dev libssl-dev libxt6 libpq-dev imagemagick ghostscript inkscape scour poppler-utils librsvg2-dev
Marc Kupietz703a4e62023-06-16 15:12:25 +020027 - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
28 - dpkg -i google-chrome-stable_current_amd64.deb || apt-get install -y -f
Marc Kupietz1f5969c2023-05-27 11:36:08 +020029 - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8
30
31 - end_section install_linux_packages
32
Marc Kupietz703a4e62023-06-16 15:12:25 +020033 - start_section testing_chromium "Testing chromium PDF export"
34 - ./ci/html2pdf https://google.com test.pdf 1
35 - ls -l ./test.pdf
36 - end_section testing_chromium
37
Marc Kupietz1f5969c2023-05-27 11:36:08 +020038 - start_section install_fonts "Installing Libertinus and Fira fonts"
39 - wget -O- https://github.com/mozilla/Fira/archive/refs/tags/4.202.tar.gz | tar -C /usr/share/fonts -zx --wildcards "*.otf"
40 - fc-cache
41 - end_section install_fonts
42
43 - start_section install_r_packages "Installing missing R packages"
Marc Kupietz533ad562023-06-26 21:29:03 +020044 - R -e "install.packages(c('devtools', 'RKorAPClient', 'httr', 'tidytext', 'httpuv', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite', 'qrcode', 'rsvg'))"
Marc Kupietz1f5969c2023-05-27 11:36:08 +020045 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
Marc Kupietz96c3af32023-06-14 07:31:46 +020046 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/posterdown")'
Marc Kupietz1f5969c2023-05-27 11:36:08 +020047 - end_section install_r_packages
48
49 script:
50 - start_section render "Running scripts"
Marc Kupietz6e21b102023-06-02 18:04:04 +020051 - R_CACHE_ROOTPATH=./cache R -f ./R/icc_stats.R
52 - 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 +020053 - 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 +020054 - ./ci/html2pdf target/poster.html target/poster.pdf 1
Marc Kupietz00cb5322023-06-15 12:22:48 +020055 - inkscape -b white --pdf-poppler -o target/poster.svg target/poster.pdf || true
56 - scour -i target/poster.svg -o target/poster_optimized.svg --enable-viewboxing --enable-id-stripping --shorten-ids --indent=none
57
Marc Kupietz1f5969c2023-05-27 11:36:08 +020058 - end_section render