|
1 | 1 | name: build |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | 4 | push: |
6 | 5 | branches: |
7 | 6 | - main |
| 7 | + pull_request: |
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | build: |
| 11 | + name: build |
| 12 | + timeout-minutes: 15 |
11 | 13 | strategy: |
12 | 14 | fail-fast: true |
13 | 15 | 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 |
24 | 20 |
|
| 21 | + runs-on: ubuntu-latest |
| 22 | + container: ${{ matrix.container }} |
25 | 23 | 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 |
31 | 25 |
|
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 |
44 | 28 |
|
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.') }} |
46 | 31 | 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 |
48 | 33 | opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip,tiny_httpd_eio |
49 | | - if: ${{ startsWith(matrix.ocaml-compiler, '5.') }} |
50 | 34 |
|
51 | 35 | - run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd |
52 | | - if: ${{ matrix.os == 'ubuntu-latest' }} |
53 | 36 |
|
54 | 37 | - run: opam install tiny_httpd |
55 | 38 |
|
56 | 39 | - run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd_camlzip |
57 | | - if: ${{ matrix.os == 'ubuntu-latest' }} |
58 | 40 |
|
59 | 41 | - run: opam install logs magic-mime -y |
60 | 42 |
|
61 | 43 | - name: Final build (OCaml 4.x) |
| 44 | + if: ${{ contains(matrix.container, 'ci-4.') }} |
62 | 45 | run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip |
63 | | - if: ${{ !startsWith(matrix.ocaml-compiler, '5.') }} |
64 | 46 |
|
65 | | - - name: Final build (OCaml 5.x, includes eio) |
| 47 | + - name: Final build (OCaml 5.x) |
| 48 | + if: ${{ !contains(matrix.container, 'ci-4.') }} |
66 | 49 | 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