blob: 166434c6d3b7340ddcf6b9a5b6402abe3c263134 [file] [log] [blame]
Marc Kupietzce1aa0c2023-06-15 07:50:23 +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
26 - 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 inkscape scour
27 - add-apt-repository ppa:saiarcot895/chromium-beta
28 - apt update
29 - apt install -y chromium-browser
30 - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8
31 - end_section install_linux_packages
32
33 - start_section install_fonts "Installing Libertinus and Fira fonts"
34 - wget -O- https://github.com/mozilla/Fira/archive/refs/tags/4.202.tar.gz | tar -C /usr/share/fonts -zx --wildcards "*.otf"
35 - fc-cache
36 - end_section install_fonts
37
38 - start_section testing_chromium Testing chromium PDF export
39 - chromium-browser --headless --no-sandbox --disable-gpu --run-all-compositor-stages-before-draw --no-pdf-header-footer --print-to-pdf=./test.pdf https://www.ids-mannheim.de/
40 - ls -l ./test.pdf
41 - end_section testing_chromium
42
43 - start_section install_r_packages "Installing missing R packages"
44 - R -e "install.packages(c('scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite'))"
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 installing "Installing posterdown (ids)"
51 - R -e 'devtools::install()'
52 - end_section installing
53 - start_section render "Generating demo artifacts"
54 - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('inst/rmarkdown/templates/posterdown_ids/skeleton/skeleton.Rmd', output_format='posterdown::posterdown_ids', output_dir='target')"
55 - ./ci/html2pdf target/skeleton.html target/skeleton.pdf 1
56 - inkscape -b white --pdf-poppler -o target/skeleton.svg target/skeleton.pdf || true
57 - scour -i target/skeleton.svg -o target/skeleton_optimized.svg --enable-viewboxing --enable-id-stripping --shorten-ids --indent=none
58 - end_section render
59