-
-
Notifications
You must be signed in to change notification settings - Fork 124
72 lines (64 loc) · 1.83 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: test
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
# - windows-latest
# Blocked until we no longer require libev; Dream still works on
# Windows, but testing it is awkward at the moment.
ocaml:
- 4.12.0
include:
- os: ubuntu-latest
ocaml: 4.08.1
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{matrix.ocaml}}
- run: opam depext --yes conf-libev
- run: opam install --yes --deps-only --with-test .
- run: opam exec -- dune runtest
- run: |
set -e
set -x
EXAMPLES=$(find example -maxdepth 1 -type d | 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
quickstart:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{matrix.os}}
steps:
- 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