From 1e2e235fd7401f9e79732bf0332c8a63491e2a2c Mon Sep 17 00:00:00 2001 From: Pierre Roux Date: Tue, 13 Feb 2024 14:32:22 +0100 Subject: [PATCH 1/4] [CI] Remove coq-bignums before CI Otherwise the test are run with the bignums already in the Docker image rather than the one just built by the CI. --- .github/workflows/docker-action.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-action.yml b/.github/workflows/docker-action.yml index 0216ceb..e36ba93 100644 --- a/.github/workflows/docker-action.yml +++ b/.github/workflows/docker-action.yml @@ -1,3 +1,5 @@ +# Beware not to destroy this file when regenerating it from meta.yml + name: Docker CI on: @@ -25,9 +27,25 @@ jobs: with: opam_file: 'coq-bignums.opam' custom_image: ${{ matrix.image }} - export: 'OPAMWITHTEST' - env: - OPAMWITHTEST: 'true' + custom_script: | + startGroup Print opam config + opam config list; opam repo list; opam list + echo NJOBS=${NJOBS} + endGroup + startGroup Build coq-bignums + opam remove -y coq-bignums # remove coq-bignums already in image + opam pin add -n -y -k path coq-bignums . + opam install -y -v -j ${NJOBS} coq-bignums + opam list + endGroup + startGroup Test coq-bignums + git config --global --add safe.directory /github/workspace # to avoid git clean below complaining + git clean -dxf . + make -j ${NJOBS} -C tests + endGroup + startGroup Uninstallation test + opam remove -y coq-bignums + endGroup # See also: # https://github.com/coq-community/docker-coq-action#readme From 29e9de3e13086609c65872b5ca8feb6c039a92ed Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 16 Feb 2024 14:53:55 +0100 Subject: [PATCH 2/4] Update .github/workflows/docker-action.yml --- .github/workflows/docker-action.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-action.yml b/.github/workflows/docker-action.yml index e36ba93..77d77c3 100644 --- a/.github/workflows/docker-action.yml +++ b/.github/workflows/docker-action.yml @@ -27,25 +27,17 @@ jobs: with: opam_file: 'coq-bignums.opam' custom_image: ${{ matrix.image }} - custom_script: | - startGroup Print opam config - opam config list; opam repo list; opam list - echo NJOBS=${NJOBS} - endGroup - startGroup Build coq-bignums + install: | + startGroup "Install dependencies" + # sudo apt-get update -y -q opam remove -y coq-bignums # remove coq-bignums already in image - opam pin add -n -y -k path coq-bignums . - opam install -y -v -j ${NJOBS} coq-bignums - opam list - endGroup - startGroup Test coq-bignums - git config --global --add safe.directory /github/workspace # to avoid git clean below complaining - git clean -dxf . - make -j ${NJOBS} -C tests - endGroup - startGroup Uninstallation test - opam remove -y coq-bignums + opam pin add -n -y -k path $PACKAGE $WORKDIR + opam update -y + opam install --confirm-level=unsafe-yes -j 2 $PACKAGE --deps-only endGroup + export: 'OPAMWITHTEST' + env: + OPAMWITHTEST: 'true' # See also: # https://github.com/coq-community/docker-coq-action#readme From 4c008f2ac9832ddf8bedc96126f79108630aa71c Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 16 Feb 2024 14:54:53 +0100 Subject: [PATCH 3/4] Fixup --- .github/workflows/docker-action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-action.yml b/.github/workflows/docker-action.yml index 77d77c3..dc43cf0 100644 --- a/.github/workflows/docker-action.yml +++ b/.github/workflows/docker-action.yml @@ -36,8 +36,8 @@ jobs: opam install --confirm-level=unsafe-yes -j 2 $PACKAGE --deps-only endGroup export: 'OPAMWITHTEST' - env: - OPAMWITHTEST: 'true' + env: + OPAMWITHTEST: 'true' # See also: # https://github.com/coq-community/docker-coq-action#readme From adc6240b63d95b6aada3dc5d6ad3326a5e13dea4 Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 16 Feb 2024 15:05:24 +0100 Subject: [PATCH 4/4] fix: Ensure "make -C tests" runs after "make install" --- coq-bignums.opam | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/coq-bignums.opam b/coq-bignums.opam index 0ac2f8d..16e28ce 100644 --- a/coq-bignums.opam +++ b/coq-bignums.opam @@ -13,10 +13,12 @@ This Coq library provides BigN, BigZ, and BigQ that used to be part of the standard library.""" build: [make "-j%{jobs}%"] -run-test: [make "-C" "tests" "-j%{jobs}%"] -install: [make "install"] +install: [ + [make "install"] + [make "-C" "tests" "-j%{jobs}%"] {with-test} +] depends: [ - "ocaml" + "ocaml" "coq" {= "dev"} ]