From e83103ecf7e7111cce1c663cd70dfdbfe7013ac6 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Wed, 28 Aug 2024 11:57:42 +0200 Subject: [PATCH] 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 --- .github/workflows/harness.yml | 5 +++-- Dockerfile | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/harness.yml b/.github/workflows/harness.yml index c2f4f45e..92f6cfa8 100644 --- a/.github/workflows/harness.yml +++ b/.github/workflows/harness.yml @@ -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/ diff --git a/Dockerfile b/Dockerfile index 3f3e4db0..bb2d2814 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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