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
56 changes: 26 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,56 +18,52 @@ 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
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

- name: Install dependencies
run: opam install . --deps-only --with-doc --with-test --with-dev-setup
- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace-${{ matrix.ocaml-version }}" >> "$GITHUB_ENV"

- name: Build
run: opam exec -- dune build @all @lint
- name: Setup Dune
uses: mbarbin/setup-dune@d38f7c80df59974cbe417c7f2a849219d54b4fdf # v2.0.0+patch-3
with:
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

- 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: Check for uncommitted changes
run: git diff --exit-code

- name: Lint opam
uses: ocaml/setup-ocaml/lint-opam@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8
- name: Lint
run: dune build @lint @fmt @unused-libs

- name: Lint fmt
uses: ocaml/setup-ocaml/lint-fmt@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8
- name: Build Doc
run: dune build @doc

- name: Lint doc
uses: ocaml/setup-ocaml/lint-doc@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8
- name: Check for uncommitted changes
run: git diff --exit-code
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
62 changes: 62 additions & 0 deletions .github/workflows/dune-pkg-more-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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:
- "**"

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml-version:
- "5.4"
- "5.3"
- "5.2"
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace-${{ matrix.ocaml-version }}" >> "$GITHUB_ENV"
echo "PACKAGES=auto-format,auto-format-tests,auto-format-example" >> "$GITHUB_ENV"

- name: Setup Dune
uses: mbarbin/setup-dune@d38f7c80df59974cbe417c7f2a849219d54b4fdf # v2.0.0+patch-3
with:
version: "3.21.0"
workspace: ${{ env.DUNE_WORKSPACE }}
cache-prefix: ${{ matrix.ocaml-version }}
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 }}
36 changes: 0 additions & 36 deletions .github/workflows/dune.yml

This file was deleted.

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

This file was deleted.

12 changes: 0 additions & 12 deletions dune-workspace

This file was deleted.

2 changes: 1 addition & 1 deletion example/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(name myconf)
(package auto-format-example)
(flags :standard -w +a-4-40-41-42-44-45-48-66 -warn-error +a)
(libraries auto-format loc parsing-utils pp sexplib0)
(libraries loc parsing-utils pp sexplib0)
(preprocess no_preprocessing))

(ocamllex lexer)
Expand Down
2 changes: 1 addition & 1 deletion test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
+a
-open
Auto_format_stdlib)
(libraries auto_format auto_format_stdlib)
(libraries auto_format_stdlib)
(instrumentation
(backend bisect_ppx))
(lint
Expand Down