Upgrade CI #154
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: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| ocaml-compiler: | |
| - 5.5.x | |
| runs-on: ${{ matrix.os }} | |
| # Keep Git maintenance in the foreground to avoid a race in opam 2.5. | |
| # See https://github.com/ocaml/opam/issues/7031. | |
| env: | |
| GIT_CONFIG_COUNT: "2" | |
| GIT_CONFIG_KEY_0: gc.autoDetach | |
| GIT_CONFIG_VALUE_0: "false" | |
| GIT_CONFIG_KEY_1: maintenance.autoDetach | |
| GIT_CONFIG_VALUE_1: "false" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup OCaml | |
| uses: ocaml/setup-ocaml@e89b2ded52a6e13f50162220cf5fe47290162032 # v3.8.0 | |
| with: | |
| ocaml-compiler: "${{ matrix.ocaml-compiler }}" | |
| 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: Build | |
| run: opam exec -- dune build @all @lint | |
| - name: Run tests | |
| run: | | |
| mkdir $BISECT_DIR | |
| opam exec -- dune runtest --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 | |
| 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@e89b2ded52a6e13f50162220cf5fe47290162032 # v3.8.0 | |
| - name: Lint fmt | |
| uses: ocaml/setup-ocaml/lint-fmt@e89b2ded52a6e13f50162220cf5fe47290162032 # v3.8.0 | |
| - name: Lint doc | |
| uses: ocaml/setup-ocaml/lint-doc@e89b2ded52a6e13f50162220cf5fe47290162032 # v3.8.0 |