blob: 1ef0245b0c40813e331f56090ccd6c0ecca2cb78 [file] [log] [blame]
# use the verse rocker image, as it contains tidyverse, devtools and some texlive
image: rocker/verse
# define stages of runner. at the moment,
# just build (no test or deploy).
stages:
- build
build-job:
stage: build
cache:
key: icc
paths:
- ./cache
artifacts:
paths:
- "target/*"
before_script:
- source `find .. -name section_helper.sh`
- start_section install_linux_packages "Installing missing Linux packages"
- apt-get update
- 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
- add-apt-repository ppa:saiarcot895/chromium-beta
- apt update
- apt install -y chromium-browser
- 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/
- locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8
- end_section install_linux_packages
- start_section install_fonts "Installing Libertinus and Fira fonts"
- wget -O- https://github.com/mozilla/Fira/archive/refs/tags/4.202.tar.gz | tar -C /usr/share/fonts -zx --wildcards "*.otf"
- fc-cache
- end_section install_fonts
- start_section install_r_packages "Installing missing R packages"
- R -e "install.packages(c('RKorAPClient', 'httr', 'tidytext', 'httpuv', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite'))"
- R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
- R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/posterdown")'
- end_section install_r_packages
script:
- start_section render "Running scripts"
- R_CACHE_ROOTPATH=./cache R -f ./R/icc_stats.R
- R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('R/report.Rmd', output_format='html_document', output_dir='target')"
- R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('R/poster.Rmd', output_format='posterdown::posterdown_ids', output_dir='target')"
- ./ci/html2pdf target/poster.html target/poster.pdf 1
- end_section render