Skip to content

Commit

Permalink
[ci] Rework CI as to be more modular
Browse files Browse the repository at this point in the history
We also remove the old !pinned method, as the setup-ocaml action does
pin Coq in all cases.

Fixes #208
  • Loading branch information
ejgallego committed May 2, 2024
1 parent 1afcb5c commit 4f8cda4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
45 changes: 20 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
test-target: [test]
extra-opam: [coq.dev]
include:
- ocaml-compiler: 4.13.1
- ocaml-compiler: 4.14.x
test-target: test
extra-opam:
coq-from-git: true
Expand All @@ -72,38 +72,33 @@ jobs:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
- name: Basic OPAM setup for SerAPI
run: |
eval $(opam env)
opam repos add coq-released http://coq.inria.fr/opam/released
opam repos add coq-core-dev http://coq.inria.fr/opam/core-dev
# coq-serapi already pinned by the setup-ocaml@v2 action
opam install --deps-only coq-serapi
run: opam repos add coq-core-dev http://coq.inria.fr/opam/core-dev
- name: Display OPAM Setup
run: |
eval $(opam env)
opam list
run: opam list
- name: Install Coq via git
if: ${{ matrix.coq-from-git }}
run: |
eval $(opam env)
# First we update SERAPI_COQ_HOME for future steps as per https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
# First we update SERAPI_COQ_HOME for future steps as per
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
echo "SERAPI_COQ_HOME=$HOME/coq-$COQ_BRANCH/_build/install/default/lib/" >> $GITHUB_ENV
# Update to coq-core some day
# opam install --deps-only coq-core
opam install --deps-only coq-core
# Clone Coq's repos
git clone --depth=3 -b "$COQ_BRANCH" "$COQ_REPOS" "$HOME/coq-$COQ_BRANCH"
# Upstream 'make -C "$HOME/coq-$COQ_BRANCH" world' target now builds coqide
# Note that Coq's 'make -C "$HOME/coq-$COQ_BRANCH" world'
# target now builds coqide too
cd "$HOME/coq-$COQ_BRANCH"
./configure -prefix "$HOME/coq-$COQ_BRANCH/_build/install/default/"
make dunestrap
dune build -p coq-core,coq-stdlib,coq
# Install deps for Coq, and build Coq
opam install --deps-only ./coq-core
opam exec -- ./configure -prefix "$HOME/coq-$COQ_BRANCH/_build/install/default/"
opam exec -- make dunestrap
opam exec -- dune build -p coq-core,coq-stdlib,coq
- name: Extra OPAM Setup (Coq.dev, misc extra tools)
if: ${{ matrix.extra-opam != '' }}
run: opam install ${{ matrix.extra-opam }}
- name: Install SerAPI deps
run: opam install --ignore-constraints-on=coq --deps-only coq-serapi
- name: Build SerAPI
run: |
eval $(opam env)
opam install ${{ matrix.extra-opam }}
- name: Build and Test SerAPI
run: |
eval $(opam env)
make -j "$NJOBS" SERAPI_COQ_HOME="$SERAPI_COQ_HOME" "${{ matrix.test-target }}"
opam exec -- make -j "$NJOBS" SERAPI_COQ_HOME="$SERAPI_COQ_HOME"
ls -lR _build/install/default/ || true
- name: Test SerAPI
run: opam exec -- make -j "$NJOBS" SERAPI_COQ_HOME="$SERAPI_COQ_HOME" "${{ matrix.test-target }}"
2 changes: 1 addition & 1 deletion coq-serapi.opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ authors: [

depends: [
"ocaml" { >= "4.09.0" }
"coq" { !pinned & >= "8.18" & < "8.19" }
"coq" { >= "8.20" & < "8.21" }
"cmdliner" { >= "1.1.0" }
"ocamlfind" { >= "1.8.0" }
"sexplib" { >= "v0.13.0" }
Expand Down

0 comments on commit 4f8cda4

Please sign in to comment.