Update and fix CI

- alpine 3.20 fixed the latex packages we had trouble with (but added a new
  caveat, and has a missing libpng dependency)

- opam 2.2 was released which means we can finally simplify depext setup
  instructions, so we now use a local switch
This commit is contained in:
Louis Gesbert 2024-08-28 11:57:42 +02:00
parent 1d7b63523e
commit e83103ecf7
2 changed files with 5 additions and 8 deletions

View File

@ -119,6 +119,7 @@ jobs:
options: --user root
env:
DUNE_PROFILE: release
OPAMSWITCH: /home/ocaml/catala
steps:
- name: Fix home
# Workaround Github actions issue, see
@ -127,7 +128,7 @@ jobs:
- name: Install LaTeX deps
# This is done late because caching would not benefit compared to
# installation through apk (1,5G upload is slow)
run: sudo apk add texlive-xetex texmf-dist-latexextra texmf-dist-binextra texmf-dist-pictures texmf-dist-fontsrecommended font-dejavu groff texmf-dist-lang
run: sudo apk add texlive-xetex texlive-dvi texmf-dist-latexextra texmf-dist-binextra texmf-dist-pictures texmf-dist-fontsrecommended font-dejavu groff libpng
# Fewer texmf deps should be required once
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/16190 is fixed
- name: Build Catala extra docs
@ -185,7 +186,7 @@ jobs:
mv catala/_build/default/_doc/_html artifacts/api-doc
mv catala/doc/syntax/syntax.pdf artifacts/
mv catala/_build/default/*.html artifacts/
mv ~/.opam/catala/doc/catala-examples/tuto*/*.html artifacts/
mv catala/_opam/doc/catala-examples/tuto*/*.html artifacts/
tar cz -hf "artifacts/french-law_ocaml.tar.gz" -C french-law/_build/install/default/lib french-law
cp catala-examples/_build/french-law_npm.tar.gz artifacts/
cp catala-examples/_build/french_law_python.tar.gz artifacts/

View File

@ -2,7 +2,7 @@
# STAGE 1: setup an opam switch with all dependencies installed
#
# (only depends on the opam files)
FROM ocamlpro/ocaml:4.14-2024-05-26 AS dev-build-context
FROM ocamlpro/ocaml:4.14-2024-08-25 AS dev-build-context
# Image from https://hub.docker.com/r/ocamlpro/ocaml
RUN mkdir catala
@ -18,12 +18,8 @@ ENV OPAMVAR_catalaz3mode=1
# Get a switch with all the dependencies installed
# DON'T run 'opam update' here. Instead use a newer parent Docker image
# (update the 'FROM' line above)
RUN opam --cli=2.1 switch create catala ocaml-system && \
opam --cli=2.1 install . --with-test --with-doc --depext-only && \
opam --cli=2.1 install . --with-test --with-doc --deps-only && \
RUN opam --cli=2.2 switch create . --deps-only --with-test --with-doc && \
opam clean
# Note: just `opam switch create . --deps-only --with-test --with-doc && opam clean`
# should be enough once opam 2.2 is released (see opam#5185)
#
# STAGE 2: get the whole repo and build