From 0448c991d2d2f14e6b816da1df2abf1d7b8c1354 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Tue, 28 Feb 2023 17:26:49 +0100 Subject: [PATCH 1/2] CI: fix publish-artifacts action --- .github/workflows/publish-artifacts.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-artifacts.yml b/.github/workflows/publish-artifacts.yml index de30ec7d..888afd33 100644 --- a/.github/workflows/publish-artifacts.yml +++ b/.github/workflows/publish-artifacts.yml @@ -2,9 +2,11 @@ name: Deploy static content to Pages on: - # Runs on pushes targeting the default branch - push: + workflow_run: + workflows: ["Harness"] branches: [master] + types: + - completed # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -23,6 +25,8 @@ concurrency: jobs: # Single deploy job since we're just deploying deploy: + # Don't run if test harness failed + if: ${{ github.event.workflow_run.conclusion == 'success' }} environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} @@ -31,10 +35,13 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v3 - name: Download build artifacts - uses: actions/download-artifact@v3 + # Not the default gh download-artifact action, which doesn't work + # between workflows + uses: dawidd6/action-download-artifact@v2 with: + workflow: ${{ github.event.workflow_run.workflow_id }} name: Catala artifacts - path: artifacts/* + path: artifacts/ - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: From 4f364306303c8c8998fd64a629aadf99e5341dac Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Tue, 28 Feb 2023 18:16:56 +0100 Subject: [PATCH 2/2] CI: don't rebuild everything twice Reverts 051a64c4b1 Gasp, I only now noticed this; it should absolutely be avoided, in general (the Docker image is expected to contain a recent repo), and in particular after switch creation. Switch to a newer image instead (or just remove the date constraint in FROM but stable builds are good). --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c8037a8..ebec23ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Stage 1: setup an opam switch with all dependencies installed # (only depends on the opam files) -FROM ocamlpro/ocaml:4.14-2022-07-17 AS dev-build-context +FROM ocamlpro/ocaml:4.14-2023-02-26 AS dev-build-context # pandoc is not in alpine stable yet, install it manually with an explicit repository RUN sudo apk add pandoc --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ @@ -17,7 +17,6 @@ ENV OPAMVAR_catalaz3mode=1 # Get a switch with all the dependencies installed RUN opam --cli=2.1 switch create catala ocaml-system && \ - opam --cli=2.1 update && \ opam --cli=2.1 pin . --no-action && \ opam --cli=2.1 install . --with-test --with-doc --depext-only && \ opam --cli=2.1 install . --with-test --with-doc --deps-only && \