From f2652be5d2fd96ba8503060d029de7c54122a70b Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Thu, 8 Jan 2026 17:28:02 +0100 Subject: [PATCH] Experiment with a setup-dune based more-ci workflow --- .github/workflows/dune-pkg-more-ci.yml | 64 ++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/dune-pkg-more-ci.yml diff --git a/.github/workflows/dune-pkg-more-ci.yml b/.github/workflows/dune-pkg-more-ci.yml new file mode 100644 index 0000000..ed99463 --- /dev/null +++ b/.github/workflows/dune-pkg-more-ci.yml @@ -0,0 +1,64 @@ +# Additional CI workflow using setup-dune (dune package management). +# This workflow is intended to eventually replace more-ci.yml. +# +# This tests across multiple operating systems and OCaml versions, but skips +# steps not necessary for every combination (linting, coverage, etc.). + +name: dune-pkg-more-ci + +on: + push: + branches: + - main + pull_request: + branches: + - "**" + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + ocaml-version: + - "5.4" + - "5.3" + - "5.2" + - "4.14" + exclude: + # Exclude the combination already tested in the main ci workflow. + - os: ubuntu-latest + ocaml-version: "5.4" + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Environment setup + run: | + echo "DUNE_WORKSPACE=$PWD/dune-workspace-${{ matrix.ocaml-version }}" >> "$GITHUB_ENV" + if [ "${{ matrix.ocaml-version }}" = "4.14" ]; then + echo "PACKAGES=fpath-sexp0" >> "$GITHUB_ENV" + else + echo "PACKAGES=fpath-sexp0,fpath-base,fpath-base-tests" >> "$GITHUB_ENV" + fi + + - name: Add dune-workspace hash to dune-project for cache key differentiation + run: | + echo "" >> dune-project + echo "; dune-workspace: ${{ hashFiles(env.DUNE_WORKSPACE) }}" >> dune-project + tail -n 2 dune-project + + - name: Setup Dune + uses: mbarbin/setup-dune@e493be45f169e50c4157ab1b6666b35570a63726 # only-packages + with: + workspace: ${{ env.DUNE_WORKSPACE }} + only-packages: ${{ env.PACKAGES }} + steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts + + - name: Build & Run tests + run: dune build @all @runtest --only-packages=${{ env.PACKAGES }}