feat(action-plugin): run dynamic-run over RPC #235
Workflow file for this run
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: Packaging check | |
| # Check every sub-package within Dune builds in isolation. This is similar to | |
| # the opam-repo-ci job to check packaging in isolation, for example: | |
| # https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/a95df9014bc79103fde668cf2adbe6680fd2f9cf/variant/compilers,5.0,fs-io.3.21.0~alpha3,tests | |
| on: | |
| workflow_call: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'opam/*.opam' | |
| pull_request: | |
| paths: | |
| - 'opam/*.opam' | |
| workflow_dispatch: | |
| jobs: | |
| packaging-check: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ocaml-compiler: | |
| - "4.14" # The oldest supported compiler version | |
| - "5" # The latest available compiler version | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - id: discover | |
| shell: bash | |
| # Discover the list of packages by reading the opam directory. Each | |
| # .opam file defines a separate package. | |
| run: | | |
| set -euo pipefail | |
| packages=$( | |
| find ./opam -maxdepth 1 -name '*.opam' -printf '%f\n' \ | |
| | sed 's/\.opam$//' \ | |
| | sort \ | |
| | jq -R -s -r 'split("\n")[:-1] | join(" ")' | |
| ) | |
| echo "packages=$packages" >> "$GITHUB_OUTPUT" | |
| - uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
| dune-cache: true | |
| opam-pin: false | |
| - name: Lint current package metadata | |
| env: | |
| packages: ${{ steps.discover.outputs.packages }} | |
| run: | | |
| for pkg in $packages; do | |
| opam lint "./opam/$pkg.opam" | |
| done | |
| - name: Pin all packages without installing | |
| # Some packages require their sibling packages to be at the same version. | |
| # All packages also depend on the current version of dune. To make these | |
| # dependencies available, we pin all packages in the `opam` directory without | |
| # installing them. This way they are pulled in only if required by the package | |
| # being built, without influencing the solver for unrelated dependencies. | |
| env: | |
| packages: ${{ steps.discover.outputs.packages }} | |
| run: | | |
| for pkg in $packages; do | |
| opam pin add "$pkg.dev" . -n | |
| done | |
| - name: Activate opam environment | |
| run: | | |
| eval $(opam env) | |
| echo "PATH=$PATH" >> $GITHUB_ENV | |
| - name: Install package | |
| env: | |
| packages: ${{ steps.discover.outputs.packages }} | |
| run: | | |
| for pkg in $packages; do | |
| opam install "$pkg.dev" --with-test -y | |
| opam remove "$pkg.dev" --auto-remove -y | |
| done | |
| - name: Lower bounds test | |
| # Verify that installation succeeds with lower-bound dependencies. | |
| # The package is removed first so that opam reinstalls it fresh, | |
| # resolving to the oldest compatible versions rather than reusing | |
| # what is already installed. | |
| env: | |
| packages: ${{ steps.discover.outputs.packages }} | |
| run: | | |
| for pkg in $packages; do | |
| opam install --solver=builtin-0install "--criteria=+count[version-lag,solution]" "$pkg.dev" -y | |
| opam remove "$pkg.dev" --auto-remove -y | |
| done |