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 |
Marc Kupietz | 703a4e6 | 2023-06-16 15:12:25 +0200 | [diff] [blame] | 2 | image: rocker/tidyverse |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 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 | 533ad56 | 2023-06-26 21:29:03 +0200 | [diff] [blame] | 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 |
Marc Kupietz | 703a4e6 | 2023-06-16 15:12:25 +0200 | [diff] [blame] | 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 Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 29 | - locale-gen de_DE.utf8 en_GB.utf8 en_US.utf8 |
| 30 | |
| 31 | - end_section install_linux_packages |
| 32 | |
Marc Kupietz | 703a4e6 | 2023-06-16 15:12:25 +0200 | [diff] [blame] | 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 | |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 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" |
Marc Kupietz | 533ad56 | 2023-06-26 21:29:03 +0200 | [diff] [blame] | 44 | - R -e "install.packages(c('devtools', 'RKorAPClient', 'httr', 'tidytext', 'httpuv', 'scales', 'sp', 'raster', 'kableExtra', 'DT', 'svglite', 'qrcode', 'rsvg'))" |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 45 | - 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] | 46 | - 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] | 47 | - end_section install_r_packages |
| 48 | |
| 49 | script: |
| 50 | - start_section render "Running scripts" |
Marc Kupietz | 6e21b10 | 2023-06-02 18:04:04 +0200 | [diff] [blame] | 51 | - R_CACHE_ROOTPATH=./cache R -f ./R/icc_stats.R |
| 52 | - 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] | 53 | - 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] | 54 | - ./ci/html2pdf target/poster.html target/poster.pdf 1 |
Marc Kupietz | 00cb532 | 2023-06-15 12:22:48 +0200 | [diff] [blame] | 55 | - inkscape -b white --pdf-poppler -o target/poster.svg target/poster.pdf || true |
| 56 | - scour -i target/poster.svg -o target/poster_optimized.svg --enable-viewboxing --enable-id-stripping --shorten-ids --indent=none |
| 57 | |
Marc Kupietz | 1f5969c | 2023-05-27 11:36:08 +0200 | [diff] [blame] | 58 | - end_section render |