blob: 8320639fd84bbcfdfb0b1f7ce3b6f79caab9d80c [file] [log] [blame]
Marc Kupietz9e33d6d2023-06-28 08:19:02 +02001# use the verse rocker image, as it contains tidyverse, devtools and some texlive
2image: rocker/tidyverse
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
26 - 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
27 - 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
29 - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8
30
31 - end_section install_linux_packages
32
33 - 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
38 - 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"
44 - R -e "install.packages(c('devtools', 'RKorAPClient', 'httr', 'tidytext', 'httpuv', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite', 'qrcode', 'rsvg'))"
45 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
46 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/posterdown")'
47 - end_section install_r_packages
48
49 script:
50 - start_section render "Running scripts"
51 - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('lvc_identification.md', output_format='posterdown::posterdown_ids', output_dir='target')"
52 - ./ci/html2pdf target/poster.html target/poster.pdf 1
53 - inkscape -b white --pdf-poppler -o target/poster.svg target/poster.pdf || true
54 - scour -i target/poster.svg -o target/poster_optimized.svg --enable-viewboxing --enable-id-stripping --shorten-ids --indent=none
55
56 - end_section render