blob: 004f18463b3f2ca8922a212678defc86d26f092b [file] [log] [blame]
Marc Kupietzce1aa0c2023-06-15 07:50:23 +02001# use the verse rocker image, as it contains tidyverse, devtools and some texlive
Marc Kupietzd0e1b3a2023-06-16 15:12:25 +02002image: rocker/tidyverse
Marc Kupietzce1aa0c2023-06-15 07:50:23 +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 Kupietzd0e1b3a2023-06-16 15:12:25 +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
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
Marc Kupietzce1aa0c2023-06-15 07:50:23 +020029 - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8
30 - end_section install_linux_packages
31
Marc Kupietzd0e1b3a2023-06-16 15:12:25 +020032 - start_section testing_chromium "Testing chromium PDF export"
33 - ./ci/html2pdf https://google.com test.pdf 1
34 - ls -l ./test.pdf
35 - end_section testing_chromium
36
Marc Kupietzce1aa0c2023-06-15 07:50:23 +020037 - start_section install_fonts "Installing Libertinus and Fira fonts"
38 - wget -O- https://github.com/mozilla/Fira/archive/refs/tags/4.202.tar.gz | tar -C /usr/share/fonts -zx --wildcards "*.otf"
39 - fc-cache
40 - end_section install_fonts
41
Marc Kupietzce1aa0c2023-06-15 07:50:23 +020042 - start_section install_r_packages "Installing missing R packages"
Marc Kupietzd0e1b3a2023-06-16 15:12:25 +020043 - R -e "install.packages(c('devtools', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite'))"
Marc Kupietzce1aa0c2023-06-15 07:50:23 +020044 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
45 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/posterdown")'
46 - end_section install_r_packages
47
48 script:
49 - start_section installing "Installing posterdown (ids)"
50 - R -e 'devtools::install()'
51 - end_section installing
52 - start_section render "Generating demo artifacts"
53 - 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')"
54 - ./ci/html2pdf target/skeleton.html target/skeleton.pdf 1
55 - inkscape -b white --pdf-poppler -o target/skeleton.svg target/skeleton.pdf || true
56 - scour -i target/skeleton.svg -o target/skeleton_optimized.svg --enable-viewboxing --enable-id-stripping --shorten-ids --indent=none
57 - end_section render
58