Upgrade dune in this ci file too #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - "**" # This will match pull requests targeting any branch | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: CI | |
| runs-on: ubuntu-latest | |
| env: | |
| OCAML_VERSION: "5.4" | |
| DUNE_VERSION: "3.23.1" | |
| DUNE_DIGEST: "sha256:9cbcc7fe3b7df76f862c9ab73c241a6106b799765bdd85c75d2e31dc5f410d07" | |
| 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.${{ env.OCAML_VERSION }}" >> "$GITHUB_ENV" | |
| - name: Setup Dune | |
| uses: mbarbin/setup-dune@03ede0220d3fe665f250727d8e21b7c0f9517f3b # v2.0.0+patch-7 | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| with: | |
| version: "${{ env.DUNE_VERSION }}" | |
| dune-digest: "${{ env.DUNE_DIGEST }}" | |
| workspace: "${{ env.DUNE_WORKSPACE }}" | |
| cache-prefix: "main-ci-${{ env.OCAML_VERSION }}" | |
| cache-readonly: ${{ github.ref != 'refs/heads/main' }} | |
| steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts | |
| - name: Build and Run tests | |
| run: | | |
| mkdir $BISECT_DIR | |
| dune build @all @runtest | |
| dune build @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: 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 | |
| - name: Check for uncommitted changes | |
| run: git diff --exit-code |