Skip to content

Update to OCaml 5.1 #377

Update to OCaml 5.1

Update to OCaml 5.1 #377

Workflow file for this run

name: CI
on: [ push, pull_request ]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "5.1.1"
- name: Install dependencies
run: opam install . --deps-only --with-test
- name: Test
run: opam exec -- dune runtest
build:
strategy:
fail-fast: false
matrix:
include:
- name: Windows
uses: windows-latest
ocaml:
ocaml-compiler: ocaml-variants.5.1.1+options,ocaml-option-mingw
# Copied from https://github.com/ocaml-multicore/eio/blob/main/.github/workflows/main.yml
opam-depext: false
opam-repositories: |
dra27: https://github.com/dra27/opam-repository.git#windows-5.0
normal: https://github.com/ocaml/opam-repository.git
input-file: illuaminate.exe
output-file: illuaminate-windows-x86_64.exe
dune-flags:
- name: Linux
uses: ubuntu-latest
# We don't use flambda as that ends up much buliker than without.
ocaml:
ocaml-compiler: ocaml-variants.5.1.1+options,ocaml-option-static
input-file: illuaminate
output-file: illuaminate-linux-x86_64
dune-flags: --workspace dune-workspace.release
- name: macOS
uses: macos-latest
ocaml:
ocaml-compiler: "5.1.1"
input-file: illuaminate
output-file: illuaminate-macos-x86_64
dune-flags:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.uses }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# This is required to make the static/musl build work. I *believe*, OCaml
# finds the glibc libzstd during ./configure, and then looks for a musl
# version when compiling. Not 100% sure, as I've not been able to reproduce
# this failure locally.
- name: Remove libzstd
run: sudo apt remove libzstd-dev --yes
if: "matrix.name == 'Linux'"
- name: Use OCaml
uses: ocaml/setup-ocaml@v2
with: ${{ matrix.ocaml }}
- name: Install dependencies
run: opam install . --deps-only
- name: Build release
run: |
opam exec -- dune subst
opam exec -- dune build ${{ matrix.dune-flags }} -p illuaminate @install
opam exec -- dune install --prefix=_install
cp _install/bin/${{ matrix.input-file }} ${{ matrix.output-file }}
- name: Publish executable
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.output-file }}
path: ${{ matrix.output-file }}
if-no-files-found: error
retention-days: 1
upload_archives:
name: Upload Archives
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download executable
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Upload
run: .github/workflows/deploy.sh 2> /dev/null
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_USER: ${{ secrets.SSH_USER }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}