diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000000..f32ad5a1c5 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,65 @@ +name: Main workflow + +on: + - pull_request + - push + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - macos-latest + - ubuntu-latest + ocaml-version: + - 4.08.x + - 4.09.x + - 4.10.x + - 4.11.x + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Use OCaml ${{ matrix.ocaml-version }} + uses: actions-ml/setup-ocaml@master + with: + ocaml-version: ${{ matrix.ocaml-version }} + dune-cache: true + opam-depext: false + opam-pin: false + + - run: | + opam pin add cohttp-async.dev . --no-action + opam pin add cohttp-lwt-jsoo.dev . --no-action + opam pin add cohttp-lwt-unix-nossl.dev . --no-action + opam pin add cohttp-lwt-unix-ssl.dev . --no-action + opam pin add cohttp-lwt-unix.dev . --no-action + opam pin add cohttp-lwt.dev . --no-action + opam pin add cohttp-mirage.dev . --no-action + opam pin add cohttp-top.dev . --no-action + opam pin add cohttp.dev . --no-action + + - run: | + opam depext --yes \ + cohttp \ + cohttp-async \ + cohttp-lwt \ + cohttp-lwt-jsoo \ + cohttp-lwt-unix \ + cohttp-lwt-unix-nossl \ + cohttp-lwt-unix-ssl \ + cohttp-mirage \ + cohttp-top \ + + - run: echo "PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig" >>"$GITHUB_ENV" + if: ${{ matrix.os == 'macos-latest' }} + + - run: opam install . --deps-only --with-doc --with-test --yes + + - run: opam exec -- make build + + - run: opam exec -- make test