Fix CI #770
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: [push, pull_request] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
# - windows-latest | |
ocaml-compiler: | |
- 5.0.x | |
- 4.14.x | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: ocaml/setup-ocaml@v3 | |
name: Use OCaml ${{matrix.ocaml-compiler}} | |
with: | |
ocaml-compiler: ${{matrix.ocaml-compiler}} | |
# For caqti Postgres tests. Opam does actually install Postgres for us, however brew | |
# doesn't link it by default, so we have to install and link it manually. | |
- name: Prepare MacOS | |
run: brew install postgresql@15 && brew link --overwrite postgresql@15 | |
if: runner.os == 'macOS' | |
- name: Install dependencies | |
run: make deps | |
- name: Test | |
run: eval $(opam env) && make test | |
# # The tests require ppx_expect. The latest versions of it introduced changes | |
# # in the formatting of the output, and also require OCaml >= 4.10, which | |
# # makes testing on < 4.10 awkward. So, we skip tests on < 4.10. | |
# - shell: bash | |
# run: | | |
# set -e | |
# set -x | |
# | |
# WITH_TEST=--with-test | |
# case ${{matrix.ocaml}} in | |
# 4.09.x) WITH_TEST=;; | |
# 4.08.x) WITH_TEST=;; | |
# esac | |
# | |
# # Tests on Windows are disabled because of a difference in ppx_expect | |
# # output. See https://github.com/aantron/dream/pull/282. | |
# case ${{runner.os}} in | |
# Windows) WITH_TEST=;; | |
# esac | |
# | |
# OPAM=$(which opam || true) | |
# if [ -z "$OPAM" ] | |
# then | |
# OPAM=D:\\cygwin\\wrapperbin\\opam.cmd | |
# fi | |
# | |
# $OPAM install --yes --deps-only $WITH_TEST ./dream-pure.opam ./dream-httpaf.opam ./dream.opam | |
# | |
# if [ ! -z "$WITH_TEST" ] | |
# then | |
# $OPAM exec -- dune runtest | |
# | |
# EXAMPLES=$(find example -maxdepth 1 -type d -not -name "w-mirage*" -not -name "r-tyxml" | grep -v "^example/0" | grep -v "^example$" | sort) | |
# shopt -s nullglob | |
# | |
# for EXAMPLE in $EXAMPLES | |
# do | |
# FILE=$(ls $EXAMPLE/*.ml $EXAMPLE/*.re $EXAMPLE/server/*.ml $EXAMPLE/server/*.re) | |
# EXE=$(echo $FILE | sed 's/\..*$/.exe/g') | |
# echo dune build $EXE | |
# $OPAM exec -- dune build $EXE | |
# done | |
# fi | |
quickstart: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
ocaml-compiler: | |
- 5.0.x | |
- 4.14.x | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: ocaml/setup-ocaml@v3 | |
name: Use OCaml ${{matrix.ocaml-compiler}} | |
with: | |
ocaml-compiler: ${{matrix.ocaml-compiler}} | |
- name: Quick start | |
run: | | |
set -x | |
touch output | |
tail -f output | grep --line-buffered 'Ctrl' | xargs -L1 -I FOO bash -c "echo Success && touch success && killall middleware.exe" & | |
tail -f output & | |
((curl -fsSL https://raw.githubusercontent.com/aantron/dream/$GITHUB_SHA/example/quickstart.sh | bash -s $GITHUB_SHA) || true) > output 2>&1 | |
sleep 1 | |
if [ -f success ] | |
then | |
exit 0 | |
else | |
exit 1 | |
fi | |
# mirage: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# submodules: recursive | |
# - run: mkdir ../repo-copy | |
# - run: cp -r * ../repo-copy/ | |
# - uses: ocaml/setup-ocaml@v3 | |
# with: | |
# ocaml-compiler: 4.14.x | |
# - run: opam install --yes --deps-only ./dream-pure.opam ./dream-httpaf.opam ./dream.opam ./dream-mirage.opam | |
# - run: opam install --yes mirage mirage-clock-unix | |
# - run: cd example/w-mirage && mv config.ml config.ml.backup | |
# - run: cd example/w-mirage && sed -e 's/package "dream-mirage"//' < config.ml.backup > config.ml | |
# - run: cd example/w-mirage && opam exec -- mirage configure -t unix | |
# - run: cd example/w-mirage && opam exec -- make depends | |
# - run: cd example/w-mirage && ls duniverse | |
# - run: cp -r ../repo-copy example/w-mirage/duniverse/dream | |
# - run: cd example/w-mirage/duniverse && rm -rf ocaml-cstruct logs ke fmt lwt bytes seq mirage-flow sexplib0 ptime tls domain-name ocaml-ipaddr mirage-clock ocplib-endian | |
# - run: cd example/w-mirage && mv config.ml.backup config.ml | |
# - run: cd example/w-mirage && sed -e 's/(libraries/(libraries dream-mirage/' < dune.build > dune.build.2 | |
# - run: cd example/w-mirage && mv dune.build.2 dune.build | |
# - run: cd example/w-mirage && opam exec -- dune build | |
# - run: file example/w-mirage/_build/default/main.exe |