Updates for OCaml 5.3 #452
Workflow file for this run
This file contains 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: build | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
schedule: | |
# Prime the caches every Monday | |
- cron: 0 1 * * MON | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
ocaml-compiler: | |
- "4.08" | |
- "4.09" | |
- "4.10" | |
- "4.11" | |
- "4.12" | |
- "4.13" | |
- "5.0" | |
- "5.1" | |
skip-test: | |
- true | |
skip-doc: | |
- true | |
skip-effects: | |
- true | |
include: | |
- os: ubuntu-latest | |
ocaml-compiler: "4.14" | |
skip-effects: true | |
skip-test: false | |
skip-doc: true | |
- os: ubuntu-latest | |
ocaml-compiler: "ocaml-variants.4.14.2+options,ocaml-option-32bit" | |
skip-effects: true | |
skip-test: false | |
skip-doc: true | |
- os: macos-latest | |
ocaml-compiler: "4.14" | |
skip-effects: true | |
skip-test: false | |
skip-doc: true | |
- os: windows-latest | |
ocaml-compiler: "4.14" | |
skip-effects: true | |
skip-test: false | |
skip-doc: true | |
- os: ubuntu-latest | |
ocaml-compiler: "5.2" | |
skip-effects: false | |
skip-test: false | |
skip-doc: false | |
# Note this OCaml compiler is bytecode only | |
- os: ubuntu-latest | |
ocaml-compiler: "ocaml-variants.5.2.0+options,ocaml-option-32bit" | |
skip-effects: true # disabled for the same reason than `skip-test` | |
skip-test: true # the `time_now.0.17` package is pulled and doesn't work in 32 bits :( | |
skip-doc: true | |
- os: macos-latest | |
ocaml-compiler: "5.2" | |
skip-effects: true | |
skip-test: false | |
skip-doc: true | |
- os: windows-latest | |
ocaml-compiler: "5.2" | |
skip-effects: false | |
skip-test: false | |
skip-doc: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set git to use LF | |
if: matrix.ocaml-compiler < 5.2 | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
git config --global core.ignorecase false | |
# EJGA: Note that I tried to fix this upstream as depext is | |
# getting much better, but no luck yet, c.f: | |
# https://github.com/ocaml/opam-repository/pull/26626 | |
- name: Install apt 32-bit dependencies | |
if: contains( matrix.ocaml-compiler, 'ocaml-option-32bit') | |
run: | | |
sudo apt-get install aptitude | |
sudo dpkg --add-architecture i386 | |
sudo aptitude -o Acquire::Retries=30 update -q | |
# Note we also install the 64-bit versions here as opam will | |
# try to install them anyways, so we save an apt-roundtrip. | |
sudo aptitude -o Acquire::Retries=30 install gcc-multilib g++-multilib pkg-config libgmp-dev libgmp-dev:i386 libx11-dev:i386 -y | |
- name: Checkout tree | |
uses: actions/checkout@v4 | |
- name: Set-up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Set-up OCaml ${{ matrix.ocaml-compiler }} | |
uses: ocaml/setup-ocaml@v3 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
dune-cache: true | |
opam-pin: false | |
- run: opam install conf-pkg-config | |
if: runner.os == 'Windows' | |
- name: Restore cached binaryen | |
id: cache-binaryen | |
uses: actions/cache/restore@v4 | |
with: | |
path: binaryen | |
key: ${{ runner.os }}-binaryen-version_118 | |
- name: Checkout binaryen | |
if: steps.cache-binaryen.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: WebAssembly/binaryen | |
path: binaryen | |
submodules: true | |
ref: version_118 | |
- name: Install ninja (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' && steps.cache-binaryen.outputs.cache-hit != 'true' | |
run: sudo apt-get install ninja-build | |
- name: Install ninja (MacOS) | |
if: matrix.os == 'macos-latest' && steps.cache-binaryen.outputs.cache-hit != 'true' | |
run: brew install ninja | |
- name: Build binaryen | |
if: matrix.os != 'windows-latest' && steps.cache-binaryen.outputs.cache-hit != 'true' | |
working-directory: ./binaryen | |
run: | | |
cmake -G Ninja . | |
ninja | |
- name: Install binaryen build dependencies (Windows) | |
if: matrix.os == 'windows-latest' && steps.cache-binaryen.outputs.cache-hit != 'true' | |
working-directory: ./binaryen | |
run: opam install conf-cmake conf-c++ | |
- name: Build binaryen (Windows) | |
if: matrix.os == 'windows-latest' && steps.cache-binaryen.outputs.cache-hit != 'true' | |
working-directory: ./binaryen | |
run: | | |
opam exec -- cmake . -DBUILD_STATIC_LIB=ON -DBUILD_TESTS=off -DINSTALL_LIBS=off -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc | |
make -j 4 | |
- name: Cache binaryen | |
if: steps.cache-binaryen.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v4 | |
with: | |
path: binaryen | |
key: ${{ runner.os }}-binaryen-version_118 | |
- name: Set binaryen's path | |
shell: bash | |
run: echo "$GITHUB_WORKSPACE/binaryen/bin" >> $GITHUB_PATH | |
- name: Copy binaryen's tools (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
# Somehow, setting the path above does not work | |
run: cp $GITHUB_WORKSPACE/binaryen/bin/wasm-{merge,opt}.exe _opam/bin | |
- name: Install faked binaryen-bin package | |
# It's faster to use a cached version | |
run: opam install --fake binaryen-bin | |
- run: opam install . --best-effort | |
if: ${{ matrix.skip-test }} | |
- run: cat VERSION | xargs opam pin . -n --with-version | |
if: ${{ !matrix.skip-test }} | |
shell: bash | |
- run: opam install conf-c++ | |
# Otherwise, the next step fails reinstalling gcc while compiling | |
# other packages | |
if: ${{ !matrix.skip-test && runner.os == 'Windows' }} | |
- run: opam install . --with-test --deps-only | |
# Install the test dependencies | |
if: ${{ !matrix.skip-test }} | |
- run: opam install . | |
# Install the packages (without running the tests) | |
if: ${{ !matrix.skip-test }} | |
- run: opam exec -- make all | |
if: ${{ !matrix.skip-test }} | |
- run: opam exec -- make tests | |
if: ${{ !matrix.skip-test }} | |
- run: opam exec -- dune build @all @runtest --profile using-effects | |
if: ${{ !matrix.skip-effects }} | |
- run: opam exec -- git diff --exit-code | |
if: ${{ !matrix.skip-test }} | |
- name: build doc | |
if: ${{ !matrix.skip-doc && github.event_name == 'push' && github.ref_name == 'master'}} | |
run: | | |
opam install odoc lwt_log cohttp-lwt-unix yojson ocp-indent graphics higlo | |
opam exec -- make doc | |
- name: synchronize doc | |
if: ${{ !matrix.skip-doc && github.event_name == 'push' && github.ref_name == 'master' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: wikidoc | |
folder: doc-dev | |
clean: true | |
target-folder: doc/dev/ |