change CI to use container images

This commit is contained in:
Simon Cruanes 2026-04-13 13:10:54 -04:00
parent 41b152c789
commit 83d408355b
3 changed files with 22 additions and 48 deletions

View file

@ -1,28 +1,17 @@
name: format
on:
pull_request:
push:
branches:
- main
pull_request:
jobs:
format:
name: format
strategy:
matrix:
ocaml-compiler:
- '5.3'
runs-on: 'ubuntu-latest'
container: ghcr.io/c-cube/c-cube-commmon/ci-doc-5.3:latest
steps:
- uses: actions/checkout@main
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
allow-prerelease-opam: true
- run: opam install ocamlformat.0.27.0
- uses: actions/checkout@v6
- run: opam exec -- make format-check

View file

@ -11,20 +11,12 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
container: ghcr.io/c-cube/c-cube-commmon/ci-doc-5.3:latest
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v6
- name: Use OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: '5.1.x'
allow-prerelease-opam: true
dune-cache: true
- run: opam pin odoc 3.1.0 -y -n
# crash with 2.4, see https://github.com/ocaml/odoc/issues/1066
- name: Deps
run: opam install odig thread-local-storage trace trace-tef trace-fuchsia ppx_trace
run: opam install thread-local-storage trace trace-tef trace-fuchsia ppx_trace
- name: Build
run: opam exec -- odig odoc --cache-dir=_doc/ trace trace-tef trace-fuchsia ppx_trace

View file

@ -1,4 +1,4 @@
name: Build and Test
name: build
on:
push:
@ -8,28 +8,21 @@ on:
jobs:
run:
name: build
name: build # build+test on various versions of OCaml, on linux
timeout-minutes: 15
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
#- macos-latest
#- windows-latest
ocaml-compiler:
- '4.08.x'
- '4.14.x'
- '5.3.x'
container:
- ghcr.io/c-cube/c-cube-commmon/ci-4.08:latest
- ghcr.io/c-cube/c-cube-commmon/ci-4.14:latest
- ghcr.io/c-cube/c-cube-commmon/ci-5.0:latest
- ghcr.io/c-cube/c-cube-commmon/ci-5.4:latest
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@main
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
allow-prerelease-opam: true
- uses: actions/checkout@v6
# check that trace compiles with no optional deps
- run: opam install -t trace --deps-only
@ -37,11 +30,11 @@ jobs:
# install all packages
- run: opam install -t trace trace-tef trace-fuchsia --deps-only
- run: opam install ppx_trace --deps-only # no tests
if: matrix.ocaml-compiler != '4.08.x'
- run: opam install ppx_trace --deps-only
if: ${{ !contains(matrix.container, 'ci-4.08') }}
- run: opam exec -- dune build '@install' -p trace,trace-tef,trace-fuchsia
- run: opam exec -- dune build '@install' -p ppx_trace
if: matrix.ocaml-compiler != '4.08.x'
if: ${{ !contains(matrix.container, 'ci-4.08') }}
- run: opam exec -- dune runtest -p trace
- run: opam install trace
- run: opam exec -- dune runtest -p trace-tef,trace-fuchsia
@ -51,9 +44,9 @@ jobs:
- run: opam exec -- dune build '@install' -p trace,trace-tef,trace-fuchsia
- run: opam install picos_aux
if: matrix.ocaml-compiler != '4.08.x' && matrix.ocaml-compiler != '4.12.x'
if: ${{ !contains(matrix.container, 'ci-4.') }}
- run: opam exec -- dune build '@install' -p trace,trace-tef,trace-fuchsia
if: matrix.ocaml-compiler != '4.08.x' && matrix.ocaml-compiler != '4.12.x'
if: ${{ !contains(matrix.container, 'ci-4.') }}
- run: opam install mtime
- run: opam exec -- dune build '@install' -p trace,trace-tef,trace-fuchsia