Skip to content

Commit cf2c3c6

Browse files
committed
docker based CI
1 parent 18b43b4 commit cf2c3c6

2 files changed

Lines changed: 21 additions & 51 deletions

File tree

.github/workflows/format.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
name: format
22

33
on:
4-
pull_request:
54
push:
65
branches:
76
- main
7+
pull_request:
88

99
jobs:
1010
format:
1111
name: format
12-
strategy:
13-
matrix:
14-
ocaml-compiler:
15-
- '5.3'
1612
runs-on: 'ubuntu-latest'
13+
container: ghcr.io/c-cube/c-cube-commmon/ci-doc-5.3:latest
1714
steps:
18-
- uses: actions/checkout@main
19-
- name: Use OCaml ${{ matrix.ocaml-compiler }}
20-
uses: ocaml/setup-ocaml@v3
21-
with:
22-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
23-
dune-cache: true
24-
allow-prerelease-opam: true
25-
26-
- run: opam install ocamlformat.0.27.0
15+
- uses: actions/checkout@v6
2716
- run: opam exec -- make format-check
28-

.github/workflows/main.yml

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,49 @@
11
name: build
22

33
on:
4-
pull_request:
54
push:
65
branches:
76
- main
7+
pull_request:
88

99
jobs:
1010
build:
11+
name: build
12+
timeout-minutes: 15
1113
strategy:
1214
fail-fast: true
1315
matrix:
14-
os:
15-
- ubuntu-latest
16-
#- macos-latest
17-
#- windows-latest
18-
ocaml-compiler:
19-
- 4.13.x
20-
- 4.14.x
21-
- 5.03.x
22-
23-
runs-on: ${{ matrix.os }}
16+
container:
17+
- ghcr.io/c-cube/c-cube-commmon/ci-4.14:latest
18+
- ghcr.io/c-cube/c-cube-commmon/ci-5.0:latest
19+
- ghcr.io/c-cube/c-cube-commmon/ci-5.4:latest
2420

21+
runs-on: ubuntu-latest
22+
container: ${{ matrix.container }}
2523
steps:
26-
- name: Checkout code
27-
uses: actions/checkout@v3
28-
29-
- run: sudo apt-get update
30-
if: ${{ matrix.os == 'ubuntu-latest' }}
24+
- uses: actions/checkout@v6
3125

32-
- name: Use OCaml ${{ matrix.ocaml-compiler }}
33-
uses: ocaml/setup-ocaml@v3
34-
with:
35-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
36-
allow-prerelease-opam: true
37-
opam-depext-flags: --with-test
38-
39-
- run: opam install ./tiny_httpd.opam ./tiny_httpd_camlzip.opam --deps-only --with-test
40-
41-
- name: Build (OCaml 4.x)
42-
run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip
43-
if: ${{ !startsWith(matrix.ocaml-compiler, '5.') }}
26+
- run: apt update && opam install ./tiny_httpd.opam ./tiny_httpd_camlzip.opam --deps-only --with-test
27+
- run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip
4428

45-
- name: Build (OCaml 5.x, includes eio)
29+
- name: Build tiny_httpd_eio (OCaml 5.x only)
30+
if: ${{ !contains(matrix.container, 'ci-4.') }}
4631
run: |
47-
opam install ./tiny_httpd.opam ./tiny_httpd_eio.opam --deps-only --with-test
32+
opam install ./tiny_httpd_eio.opam --deps-only --with-test
4833
opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip,tiny_httpd_eio
49-
if: ${{ startsWith(matrix.ocaml-compiler, '5.') }}
5034
5135
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd
52-
if: ${{ matrix.os == 'ubuntu-latest' }}
5336

5437
- run: opam install tiny_httpd
5538

5639
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd_camlzip
57-
if: ${{ matrix.os == 'ubuntu-latest' }}
5840

5941
- run: opam install logs magic-mime -y
6042

6143
- name: Final build (OCaml 4.x)
44+
if: ${{ contains(matrix.container, 'ci-4.') }}
6245
run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip
63-
if: ${{ !startsWith(matrix.ocaml-compiler, '5.') }}
6446

65-
- name: Final build (OCaml 5.x, includes eio)
47+
- name: Final build (OCaml 5.x)
48+
if: ${{ !contains(matrix.container, 'ci-4.') }}
6649
run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip,tiny_httpd_eio
67-
if: ${{ startsWith(matrix.ocaml-compiler, '5.') }}

0 commit comments

Comments
 (0)