Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 1 | # use the verse rocker image, as it contains tidyverse, devtools and some texlive |
| 2 | image: rocker/verse |
| 3 | |
| 4 | # define stages of runner. at the moment, |
| 5 | # just build (no test or deploy). |
| 6 | stages: |
| 7 | - build |
| 8 | |
| 9 | build-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 Kupietz | e073034 | 2023-06-14 09:52:17 +0200 | [diff] [blame] | 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 |
| 27 | - add-apt-repository ppa:saiarcot895/chromium-beta |
| 28 | - apt update |
| 29 | - apt install -y chromium-browser |
| 30 | - 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/ |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 31 | - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8 |
| 32 | |
| 33 | - end_section install_linux_packages |
| 34 | |
| 35 | - start_section install_fonts "Installing Libertinus and Fira fonts" |
| 36 | - wget -O- https://github.com/mozilla/Fira/archive/refs/tags/4.202.tar.gz | tar -C /usr/share/fonts -zx --wildcards "*.otf" |
| 37 | - fc-cache |
| 38 | - end_section install_fonts |
| 39 | |
| 40 | - start_section install_r_packages "Installing missing R packages" |
Marc Kupietz | 6e21b10 | 2023-06-02 18:04:04 +0200 | [diff] [blame] | 41 | - R -e "install.packages(c('RKorAPClient', 'httr', 'tidytext', 'httpuv', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite'))" |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 42 | - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")' |
Marc Kupietz | 96c3af3 | 2023-06-14 07:31:46 +0200 | [diff] [blame] | 43 | - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/posterdown")' |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 44 | - end_section install_r_packages |
| 45 | |
| 46 | script: |
| 47 | - start_section render "Running scripts" |
Marc Kupietz | 6e21b10 | 2023-06-02 18:04:04 +0200 | [diff] [blame] | 48 | - R_CACHE_ROOTPATH=./cache R -f ./R/icc_stats.R |
| 49 | - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('R/report.Rmd', output_format='html_document', output_dir='target')" |
Marc Kupietz | 96c3af3 | 2023-06-14 07:31:46 +0200 | [diff] [blame] | 50 | - R_CACHE_ROOTPATH=./cache R -e "require(rmarkdown); render('R/poster.Rmd', output_format='posterdown::posterdown_ids', output_dir='target')" |
Marc Kupietz | e073034 | 2023-06-14 09:52:17 +0200 | [diff] [blame] | 51 | - ./ci/html2pdf target/poster.html target/poster.pdf 1 |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 52 | - end_section render |
| 53 | |