Skip to content

Upgrade CIs

Upgrade CIs #67

# Additional CI workflow using setup-dune (dune package management).
#
# 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:
- "**"
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml-version:
- "5.4"
- "5.3"
- "5.2"
- "4.14"
include:
- os: ubuntu-latest
dune-version: "3.22.0"
dune-digest: "sha256:33ca9308b48d9f5e90ee34f5b1045b53df6b5780a188556dab72af53621b5fba"
- os: macos-latest
dune-version: "3.22.0"
dune-digest: "sha256:66aa2c005b1c5c60daf711aee0630cc988b6038aa86ca807879e281145f232cb"
exclude:
# Exclude the combination already tested in the main ci workflow.
- os: ubuntu-latest
ocaml-version: "5.4"
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace.${{ matrix.ocaml-version }}" >> "$GITHUB_ENV"
if [ "${{ matrix.ocaml-version }}" = "4.14" ]; then
echo "PACKAGES=volgo,volgo-vcs,volgo-git-backend,volgo-git-unix,volgo-hg-backend,volgo-hg-unix" >> "$GITHUB_ENV"
else
echo "PACKAGES=volgo,volgo-base,volgo-base-tests,volgo-vcs,volgo-git-backend,volgo-git-unix,volgo-git-eio,volgo-hg-backend,volgo-hg-unix,volgo-hg-eio,vcs-test-helpers,volgo-tests" >> "$GITHUB_ENV"
fi
- name: Setup Dune
uses: mbarbin/setup-dune@03ede0220d3fe665f250727d8e21b7c0f9517f3b # v2.0.0+patch-7
env:
GH_TOKEN: ${{ github.token }}
with:
version: "${{ matrix.dune-version }}"
dune-digest: "${{ matrix.dune-digest }}"
workspace: "${{ env.DUNE_WORKSPACE }}"
cache-prefix: "${{ matrix.ocaml-version }}"
cache-readonly: ${{ github.ref != 'refs/heads/main' }}
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 }}