Skip to content

Add a configuration option to enable package management (#12025) #296

Add a configuration option to enable package management (#12025)

Add a configuration option to enable package management (#12025) #296

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
merge_group:
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
# Please keep the list in sync with the minimal version of OCaml in
# dune-project, dune.opam.template and bootstrap.ml
#
# We don't run tests on all versions of the Windows environment and on
# 4.02.x and 4.07.x in other environments
include:
# OCaml trunk:
- ocaml-compiler: ocaml-variants.5.4.0+trunk
os: ubuntu-latest
skip_test: true
# OCaml 5:
## ubuntu (x86)
- ocaml-compiler: 5.3.x
os: ubuntu-latest
## macos (Apple Silicon)
- ocaml-compiler: 5.3.x
os: macos-latest
## macos (x86)
- ocaml-compiler: 5.3.x
os: macos-13
skip_test: true
## MSVC
- ocaml-compiler: ocaml-compiler.5.3.0,system-msvc
os: windows-latest
## mingw
- ocaml-compiler: ocaml-base-compiler.5.3.0,system-mingw
os: windows-latest
# OCaml 4:
## ubuntu (x86)
- ocaml-compiler: 4.14.x
os: ubuntu-latest
skip_test: true
## ubuntu (x86-32)
- ocaml-compiler: "ocaml-variants.4.14.2+options,ocaml-option-32bit"
os: ubuntu-latest
skip_test: true
apt_update: true
## macos (Apple Silicon)
- ocaml-compiler: 4.14.x
os: macos-latest
skip_test: true
# OCaml 4.08:
## ubuntu (x86)
- ocaml-compiler: 4.08.x
os: ubuntu-latest
skip_test: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
# git user needs to be configured for the following tests:
# otherlibs/build-info/test/run.t
# test/blackbox-tests/test-cases/dune-project-meta/run.t
# test/blackbox-tests/test-cases/subst/run.t
# test/expect-tests/vcs_tests.ml
- name: Set git user
run: |
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com
# The 32 bit gcc/g++ packages are by default out-of-date so we need to
# manually update our package listing.
- name: Update apt package listing
if: ${{ matrix.apt_update == true }}
run: sudo apt update
# Install ocamlfind-secondary and ocaml-secondary-compiler, if needed
- run: opam install ./dune.opam --deps-only --with-test
- name: Install system deps on macOS
run: brew install coreutils pkg-config file
if: ${{ matrix.os == 'macos-latest' }}
# dune doesn't have any additional dependencies so we can build it right
# away this makes it possible to see build errors as soon as possible
- run: opam exec -- make release
- name: Install deps
run: |
opam install . --deps-only --with-test
opam exec -- make dev-deps
if: ${{ matrix.skip_test == false }}
- name: Run test suite on Unix
run: opam exec -- make test
if: ${{ matrix.os != 'windows-latest' && matrix.skip_test == false }}
- name: Run test suite on Win32
run: opam exec -- make test-windows
if: ${{ matrix.os == 'windows-latest' && matrix.skip_test == false }}
- name: Build configurator
run: opam install ./dune-configurator.opam
if: ${{ matrix.configurator == true }}
nix:
name: Nix
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- run: nix build
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- run: nix develop .#fmt -c make fmt
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- run: nix develop .#doc -c make doc
env:
LC_ALL: C
coq:
name: Coq 8.16.1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- run: nix develop .#coq -c make test-coq
env:
# We disable the Dune cache when running the tests
DUNE_CACHE: disabled
wasm:
name: Wasm_of_ocaml
runs-on: ubuntu-latest
steps:
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: latest
- name: Set-up Binaryen
uses: Aandreba/[email protected]
with:
token: ${{ github.token }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Use OCaml 5.2.x
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5.2.x
- name: Install faked binaryen-bin package
# The binaries have already been downloaded
run: opam install --fake binaryen-bin
- name: Install Wasm_of_ocaml
run: opam install "wasm_of_ocaml-compiler>=6.1"
- name: Set Git User
run: |
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com
- name: Run Tests
run: opam exec -- make test-wasm
create-local-opam-switch:
name: Create local opam switch
strategy:
fail-fast: true
matrix:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- 5
- 4.14
runs-on: ${{ matrix.os }}
steps:
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- uses: actions/checkout@v4
- name: Create an empty switch
run: opam switch create . --empty
- name: Pin local packages to local dependencies
run: opam pin add . -n --with-version=dev
- name: Install external dependencies
run: opam install .
build-microbench:
name: Build microbenchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- run: nix develop .#microbench -c make dune build bench/micro