tiny_httpd/.github/workflows/main.yml
2026-02-15 20:59:50 +00:00

67 lines
2 KiB
YAML

name: build
on:
pull_request:
push:
branches:
- main
jobs:
build:
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
#- macos-latest
#- windows-latest
ocaml-compiler:
- 4.13.x
- 4.14.x
- 5.03.x
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- run: sudo apt-get update
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
allow-prerelease-opam: true
opam-depext-flags: --with-test
- run: opam install ./tiny_httpd.opam ./tiny_httpd_camlzip.opam --deps-only --with-test
- name: Build (OCaml 4.x)
run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip
if: ${{ !startsWith(matrix.ocaml-compiler, '5.') }}
- name: Build (OCaml 5.x, includes eio)
run: |
opam install ./tiny_httpd_eio.opam --deps-only --with-test
opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip,tiny_httpd_eio
if: ${{ startsWith(matrix.ocaml-compiler, '5.') }}
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd
if: ${{ matrix.os == 'ubuntu-latest' }}
- run: opam install tiny_httpd
- run: opam exec -- dune build @src/runtest @examples/runtest @tests/runtest -p tiny_httpd_camlzip
if: ${{ matrix.os == 'ubuntu-latest' }}
- run: opam install logs magic-mime -y
- name: Final build (OCaml 4.x)
run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip
if: ${{ !startsWith(matrix.ocaml-compiler, '5.') }}
- name: Final build (OCaml 5.x, includes eio)
run: opam exec -- dune build @install -p tiny_httpd,tiny_httpd_camlzip,tiny_httpd_eio
if: ${{ startsWith(matrix.ocaml-compiler, '5.') }}