GitHub Action for setting up OCaml environment, but faster.
This action aggressively uses some low compatibility assumptions to boost up CI.
This action doesn't try to be standalone. Instead of doing everything, it lets users choose a better option themselves.
It should provides enough inputs/outputs context for better composiblities.
By default, opam init
installs system dependencies needed in OCaml development.
This action tries to skip this process or replace it with a shortcut wherever possible. According to following assumptions:
- Some dependencies are optional.
- E.g.
rsync
,git
,mercurial
is not needed if there is no pinnned dependecencies
- E.g.
- Some are already installed in the runner.
- E.g.
g++
or Cygwin (mysys) is already installed on the GitHub hosted runners.
- E.g.
- There may be faster alternative installers.
- For Ubuntu,
awalsh128/cache-apt-pkgs-action
could be much better. - For Windows, use WinGet (available on
windows-2025
runners).
- For Ubuntu,
The GitHub-hosted runners have different versions and types of pre-installed dependencies for each version, and the *-latest
runners are not the latest.
This is especially significant for Windows, where the windows-2025
image includes the latest OS features such as the built-in WinGet package manager and Dev Drive with ReFS.
The default C:
drive in the Windows runners is more than x10 slower than the D:
drive provided for temporary files. This slows down most of the build and installation scripts that are IO intensive.
- actions/runner-images#8755
- astral-sh/uv#3522
- https://github.com/samypr100/setup-dev-drive
- https://ichard26.github.io/blog/2025/03/faster-pip-ci-on-windows-d-drive/
GitHub Actions provides 10GB of cache space on public repositories.
Even optimized processes can still be slow, so this action tries to cache and skip as much work as possible.
- Dependencies installation
- Most of
opam init
- Project build cache
Which doens't make sense for CI. It's already isolsated in the workflow level.