Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 28 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,65 +18,61 @@ jobs:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 5.4.x
ocaml-version:
- "5.4"

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash

steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Setup OCaml
uses: ocaml/setup-ocaml@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8
- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace-${{ matrix.ocaml-version }}" >> "$GITHUB_ENV"

- name: Setup Dune
uses: mbarbin/setup-dune@d38f7c80df59974cbe417c7f2a849219d54b4fdf # v2.0.0+patch-3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
opam-repositories: |
default: https://github.com/ocaml/opam-repository.git
mbarbin: https://github.com/mbarbin/opam-repository.git
alpha: https://github.com/kit-ty-kate/opam-alpha-repository.git
# janestreet-bleeding: https://github.com/janestreet/opam-repository.git
# janestreet-bleeding-external: https://github.com/janestreet/opam-repository.git#external-packages
version: "3.21.0"
workspace: ${{ env.DUNE_WORKSPACE }}
cache-prefix: "main-ci-${{ matrix.ocaml-version }}"
steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts

# Setting `(implicit_transitive_deps VALUE)` conditionally based on the compiler version.
# Setting implicit_transitive_deps based on the compiler version.
- name: Edit dune-project
run: opam exec -- ocaml .github/workflows/edit_dune_project_dot_ml "${{ matrix.ocaml-compiler }}"

- name: Install dependencies
run: opam install . --deps-only --with-doc --with-test --with-dev-setup

- name: Build
run: opam exec -- dune build @all @lint
run: sed -i 's/(implicit_transitive_deps [^)]*)/(implicit_transitive_deps false)/' dune-project

- name: Run tests
- name: Build and Run tests
run: |
rm -rf _build/default/
mkdir $BISECT_DIR
opam exec -- dune runtest --instrument-with bisect_ppx
dune build @all @runtest --force --instrument-with bisect_ppx
env:
BISECT_DIR: ${{ runner.temp }}/_bisect_ppx_data
BISECT_FILE: ${{ runner.temp }}/_bisect_ppx_data/data

- name: Send coverage report to Coveralls
run: opam exec -- bisect-ppx-report send-to Coveralls --coverage-path $BISECT_DIR
run: dune exec -- bisect-ppx-report send-to Coveralls --coverage-path $BISECT_DIR
env:
BISECT_DIR: ${{ runner.temp }}/_bisect_ppx_data
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}

- name: Lint
run: dune build @lint @fmt @unused-libs

- name: Build Doc
run: dune build @doc

# Before checking for uncommitted changes we need to restore changes
# potentially made to the dune-project file.
- name: Restore dune-project
run: git restore dune-project

- name: Check for uncommitted changes
run: git diff --exit-code

- name: Lint opam
uses: ocaml/setup-ocaml/lint-opam@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8

- name: Lint fmt
uses: ocaml/setup-ocaml/lint-fmt@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8

- name: Lint doc
uses: ocaml/setup-ocaml/lint-doc@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8
27 changes: 13 additions & 14 deletions .github/workflows/deploy-odoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
build:
name: Build OCaml Doc
runs-on: ubuntu-latest
env:
OCAML_VERSION: "5.4"
defaults:
run:
shell: bash
Expand All @@ -23,23 +25,20 @@ jobs:
with:
fetch-depth: 0

- name: Setup OCaml
uses: ocaml/setup-ocaml@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8
with:
ocaml-compiler: "5.4.x"
dune-cache: true
opam-repositories: |
default: https://github.com/ocaml/opam-repository.git
mbarbin: https://github.com/mbarbin/opam-repository.git
alpha: https://github.com/kit-ty-kate/opam-alpha-repository.git
# janestreet-bleeding: https://github.com/janestreet/opam-repository.git
# janestreet-bleeding-external: https://github.com/janestreet/opam-repository.git#external-packages
- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace-${{ env.OCAML_VERSION }}" >> "$GITHUB_ENV"

- name: Install OCaml Dependencies
run: opam install . --deps-only --with-doc
- name: Setup Dune
uses: mbarbin/setup-dune@d38f7c80df59974cbe417c7f2a849219d54b4fdf # v2.0.0+patch-3
with:
version: "3.21.0"
workspace: ${{ env.DUNE_WORKSPACE }}
cache-prefix: "deploy-odoc-${{ env.OCAML_VERSION }}"
steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts

- name: Build Odoc Pages
run: opam exec -- dune build @doc
run: dune build @doc

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dune-pkg-more-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# 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.).
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/dunolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install dunolint
uses: mbarbin/dunolint-actions/setup-dunolint@2ba7453b5904f39688a3e656c770a5b9727163d0 # v1.0.0-alpha.3
uses: mbarbin/dunolint-actions/setup-dunolint@6b1c0591ba857063829211bc162712052889c4e2 # v1.0.0-alpha.4
with:
dunolint-version: 0.0.20260103
dunolint-digest: sha256:2771c39def3ae771735e105bf22f3ab67745354ed13e7263284a866625eacb69

- name: Lint Check
uses: mbarbin/dunolint-actions/lint-check@2ba7453b5904f39688a3e656c770a5b9727163d0 # v1.0.0-alpha.3
uses: mbarbin/dunolint-actions/lint-check@6b1c0591ba857063829211bc162712052889c4e2 # v1.0.0-alpha.4
73 changes: 0 additions & 73 deletions .github/workflows/edit_dune_project_dot_ml

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/more-ci.yml

This file was deleted.

1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @mbarbin
12 changes: 0 additions & 12 deletions dune-workspace

This file was deleted.