Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #337

Merged
merged 51 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
41d89d6
ci: add opam to quickstart
maxRN Aug 21, 2024
769bffb
ci: use ocaml/setup-ocaml action
maxRN Aug 21, 2024
11d77fb
ci: use ocaml/setup-ocaml in quickstart test
maxRN Aug 21, 2024
a63cf12
ci: run only on ubuntu
maxRN Aug 21, 2024
d658771
ci: fix syntax
maxRN Aug 21, 2024
2020424
ci: don't depext; install dune
maxRN Aug 21, 2024
96ba24b
ci: add name to ocaml action
maxRN Aug 21, 2024
14edeff
ci: only run test for now
maxRN Aug 21, 2024
05f435d
ci: only run a few combinations
maxRN Aug 21, 2024
25b0c6e
ci: eval after dune installation
maxRN Aug 21, 2024
eb30e58
ci: try using dune
maxRN Aug 21, 2024
404bae9
ci: try eval'ing opam before using dune
maxRN Aug 21, 2024
06dcb90
ci: try w/o installing dune
maxRN Aug 21, 2024
916c549
ci: run on windows, macos; don't run on > 5.0
maxRN Aug 22, 2024
b37b0db
ci: install and link postgres
maxRN Aug 22, 2024
18ec729
ci: disable windows for now
maxRN Aug 22, 2024
40d1ee9
ci: try macos
maxRN Aug 22, 2024
29aa17a
ci: use correct OS name
maxRN Aug 22, 2024
ece6216
ci: try quickstart; try w/o Postgres
maxRN Aug 23, 2024
a8b6dd2
ci: set name for quickstart; don't install mirage for normal tests
maxRN Aug 23, 2024
ce7729f
ci: fix Quickstart ocaml action
maxRN Aug 23, 2024
df4f7b4
ci: go back to installing Postgres
maxRN Aug 23, 2024
38ad596
ci: re-enable mirage tests
maxRN Aug 23, 2024
4cffbc0
chore: bump letsencrypt dependency
maxRN Aug 23, 2024
eb233b9
Revert "ci: re-enable mirage tests"
maxRN Aug 23, 2024
553fab2
Reapply "ci: re-enable mirage tests"
maxRN Aug 23, 2024
801e49f
Revert "chore: bump letsencrypt dependency"
maxRN Aug 23, 2024
15016b4
Revert "Reapply "ci: re-enable mirage tests""
maxRN Aug 23, 2024
154fdb9
Don't need a full matrix; try Windows
aantron Sep 3, 2024
b3358d9
Fix .yml file
aantron Sep 3, 2024
7d901cd
Constrain ppx_expect due to breaking changes
aantron Sep 3, 2024
e41aee4
Try returning to the Windows sunset repo to fix ssl install
aantron Sep 3, 2024
a158048
Try again
aantron Sep 3, 2024
3d22e2b
Undo using sunset repo, likely even more bit rot
aantron Sep 3, 2024
5572781
Pin package ssl to 0.6.0
aantron Sep 3, 2024
ae9a871
Remove step names and use opam exec for tests
aantron Sep 3, 2024
ea6761a
Don't try to run ppx_expect tests on Windows
aantron Sep 3, 2024
8806c6b
Restore example building
aantron Sep 3, 2024
e61de74
Don't need a full matrix for quickstart, but try Windows
aantron Sep 3, 2024
db36452
Reduce diff
aantron Sep 3, 2024
64e329f
Try Mirage again
aantron Sep 3, 2024
40d8c92
Tweak comment
aantron Sep 3, 2024
f6d4e4b
Windows: need to run quickstart.sh in bash
aantron Sep 3, 2024
790b505
Push Quick start on Windows, and Mirage
aantron Sep 3, 2024
995a5c4
Abandon Quick start on Windows for now, environment is broken in a bi…
aantron Sep 3, 2024
3b072cf
Mirage
aantron Sep 3, 2024
2f41ffa
Mirage
aantron Sep 3, 2024
06ca0a9
Mirage
aantron Sep 3, 2024
2a42d93
Mirage
aantron Sep 3, 2024
9e172f3
Mirage
aantron Sep 3, 2024
4bcbcaa
Disable Mirage build
aantron Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 42 additions & 57 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,99 +9,81 @@ jobs:
os:
- ubuntu-latest
ocaml:
- 5.0.x
- 5.2.x
- 4.14.x
- 4.13.x
- 4.12.x
- 4.11.x
- 4.10.x
- 4.09.x
- 4.08.x
include:
- os: macos-latest
ocaml: 4.12.x
ocaml: 4.14.x
- os: windows-latest
ocaml: 4.14.x

runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: avsm/setup-ocaml@v2
if: runner.os != 'Windows'
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{matrix.ocaml}}

- uses: avsm/setup-ocaml@v2
# For Caqti PostgreSQL examples. opam does actually install PostgreSQL for
# us. However, Homebrew doesn't link it by default, so we have to install
# and link it manually.
- run: brew install postgresql@15 && brew link --overwrite postgresql@15
if: runner.os == 'macOS'

# Workaround https://github.com/savonet/ocaml-ssl/issues/155 and/or
# https://github.com/ocaml/setup-ocaml/issues/856.
- run: opam pin add ssl 0.6.0 --no-action
if: runner.os == 'Windows'
with:
ocaml-compiler: ${{matrix.ocaml}}
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git

- run: opam depext --yes conf-sqlite3
- run: opam depext --yes conf-postgresql
- run: opam depext --yes conf-libev
- run: opam exec -- make deps

- run: opam exec -- make

# Tests on Windows are disabled because of a difference in ppx_expect
# output. See https://github.com/aantron/dream/pull/282. This difference
# remains as of ppx_expect 0.16.
- run: opam exec -- make test
if: runner.os != 'Windows'

# 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
- name: Build examples
if: runner.os != 'Windows'
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
opam exec -- dune build $EXE
done
fi

quickstart:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml:
- 5.2.x
- 4.14.x
include:
- os: macos-latest
ocaml: 4.14.x

runs-on: ${{matrix.os}}
steps:
- name: Quick start
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{matrix.ocaml}}

- name: Run quickstart.sh
shell: bash
run: |
set -x
touch output
Expand All @@ -117,25 +99,28 @@ jobs:
fi

mirage:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: mkdir ../repo-copy
- run: cp -r * ../repo-copy/
- uses: avsm/setup-ocaml@v2
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 4.14.x
# Needed until https://github.com/robur-coop/ocaml-letsencrypt/pull/34.
- run: opam pin add letsencrypt git+https://github.com/hannesm/ocaml-letsencrypt.git#no-cstruct --no-action
- 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: opam install --yes mirage mirage-clock-unix mirage-crypto-rng-mirage
- 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/duniverse && rm -rf ocaml-cstruct logs ke fmt lwt bytes seq mirage-flow sexplib0 ptime tls domain-name ocaml-ipaddr mirage-clock ocplib-endian digestif eqaf mirage-crypto mirage-runtime
- 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
Expand Down
2 changes: 1 addition & 1 deletion dream.opam
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ depends: [
"html_of_jsx" {with-test}
"js_of_ocaml" {with-test}
"js_of_ocaml-ppx" {with-test}
"ppx_expect" {with-test & >= "v0.15.0"} # Formatting changes.
"ppx_expect" {with-test & >= "v0.15.0" & < "v0.17.0"} # Breaking changes.
"ppx_yojson_conv" {with-test}
"reason" {with-test}
"tyxml" {with-test & >= "4.5.0"}
Expand Down