diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a815cf7..d0316a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,9 @@ on: branches: - "**" # This will match pull requests targeting any branch +permissions: + contents: read + jobs: build: strategy: @@ -15,42 +18,40 @@ jobs: matrix: os: - ubuntu-latest - ocaml-compiler: - - 5.3.x + ocaml-version: + - "5.4" runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - 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@ae2985bcdedc6fb24e5743d6f9dace9cf262b41c # v2.0.0+patch-4 with: - ocaml-compiler: ${{ matrix.ocaml-compiler }} - opam-repositories: | - default: https://github.com/ocaml/opam-repository.git - mbarbin: https://github.com/mbarbin/opam-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 }}" + cache-readonly: ${{ github.ref != 'refs/heads/main' }} + steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts - - name: Install dependencies - run: opam install . --deps-only --with-doc --with-test --with-dev-setup + - name: Build and Run Tests + run: dune build @all @runtest - - name: Build - run: opam exec -- dune build @all @lint + - name: Lint + run: dune build @lint @fmt @unused-libs - - name: Run tests - run: opam exec -- dune runtest + - name: Build Doc + run: dune build @doc - 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 diff --git a/.github/workflows/deploy-doc.yml b/.github/workflows/deploy-doc.yml index 11c1def..64f84eb 100644 --- a/.github/workflows/deploy-doc.yml +++ b/.github/workflows/deploy-doc.yml @@ -7,10 +7,15 @@ on: # Review gh actions docs if you want to further define triggers, paths, etc # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on +permissions: + contents: read + jobs: build: name: Build Docusaurus runs-on: ubuntu-latest + env: + OCAML_VERSION: "5.4" defaults: run: shell: bash @@ -29,23 +34,23 @@ jobs: - name: Install Docusaurus Dependencies working-directory: ./doc - run: npm ci + run: npm ci --ignore-scripts - - name: Setup OCaml - uses: ocaml/setup-ocaml@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8 - with: - ocaml-compiler: "5.3.x" - opam-repositories: | - default: https://github.com/ocaml/opam-repository.git - mbarbin: https://github.com/mbarbin/opam-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@ae2985bcdedc6fb24e5743d6f9dace9cf262b41c # v2.0.0+patch-4 + with: + version: "3.21.0" + workspace: ${{ env.DUNE_WORKSPACE }} + cache-prefix: "main-ci-${{ env.OCAML_VERSION }}" + cache-readonly: true + 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: Copy Odoc Pages to Docusaurus Static Directory run: | diff --git a/.github/workflows/test-deploy-doc.yml b/.github/workflows/test-deploy-doc.yml index b244566..dede50a 100644 --- a/.github/workflows/test-deploy-doc.yml +++ b/.github/workflows/test-deploy-doc.yml @@ -7,10 +7,15 @@ on: # Review gh actions docs if you want to further define triggers, paths, etc # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on +permissions: + contents: read + jobs: test-deploy: name: Test deployment runs-on: ubuntu-latest + env: + OCAML_VERSION: "5.4" defaults: run: shell: bash @@ -29,23 +34,23 @@ jobs: - name: Install Docusaurus Dependencies working-directory: ./doc - run: npm ci + run: npm ci --ignore-scripts - - name: Setup OCaml - uses: ocaml/setup-ocaml@dec6499fef64fc5d7ed43d43a87251b7b1c306f5 # v3.4.8 - with: - ocaml-compiler: "5.3.x" - opam-repositories: | - default: https://github.com/ocaml/opam-repository.git - mbarbin: https://github.com/mbarbin/opam-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@ae2985bcdedc6fb24e5743d6f9dace9cf262b41c # v2.0.0+patch-4 + with: + version: "3.21.0" + workspace: ${{ env.DUNE_WORKSPACE }} + cache-prefix: "main-ci-${{ env.OCAML_VERSION }}" + cache-readonly: true + 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: Copy Odoc Pages to Docusaurus Static Directory run: | diff --git a/dune-workspace-5.4 b/dune-workspace-5.4 new file mode 100644 index 0000000..24220a9 --- /dev/null +++ b/dune-workspace-5.4 @@ -0,0 +1,13 @@ +(lang dune 3.20) + +(pkg enabled) + +(lock_dir + (repositories overlay upstream mbarbin) + (constraints + (ocaml + (= 5.4.1)))) + +(repository + (name mbarbin) + (url "git+https://github.com/mbarbin/opam-repository.git")) diff --git a/third-party-license/README.md b/third-party-license/README.md index fe6a497..0ffaf96 100644 --- a/third-party-license/README.md +++ b/third-party-license/README.md @@ -40,9 +40,9 @@ See the [actions/upload-pages-artifact license](https://github.com/actions/uploa --- -## ocaml/setup-ocaml +## ocaml-dune/setup-dune -- Repository: https://github.com/ocaml/setup-ocaml +- Repository: https://github.com/ocaml-dune/setup-dune - License: MIT License -See the [ocaml/setup-ocaml license](https://github.com/ocaml/setup-ocaml/blob/master/LICENSE) for full details. +See the [ocaml-dune/setup-dune license](https://github.com/ocaml-dune/setup-dune/blob/main/LICENSE.md) for full details. diff --git a/third-party-license/ocaml/setup-ocaml/LICENSE b/third-party-license/ocaml-dune/setup-dune/LICENSE.md similarity index 94% rename from third-party-license/ocaml/setup-ocaml/LICENSE rename to third-party-license/ocaml-dune/setup-dune/LICENSE.md index 761ba84..376d252 100644 --- a/third-party-license/ocaml/setup-ocaml/LICENSE +++ b/third-party-license/ocaml-dune/setup-dune/LICENSE.md @@ -1,6 +1,6 @@ -MIT License +# MIT License -Copyright (c) 2019 Anil Madhavapeddy +Copyright (c) 2025-2026 Tarides, Samuel Hym Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal