Skip to content

Commit dc57418

Browse files
committed
Ci: Install, and fail on individual test fails
1 parent 3652231 commit dc57418

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ jobs:
1717
with:
1818
toit-version: 'v2.0.0-alpha.120'
1919

20+
- run: make install
2021
- run: make test

Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1+
.PHONY: install
2+
install:
3+
@if command -v jag >/dev/null 2>&1; then \
4+
jag pkg install; \
5+
elif command -v toit >/dev/null 2>&1; then \
6+
toit.pkg install; \
7+
else \
8+
echo "Error: Neither 'jag' nor 'toit' found in PATH"; \
9+
exit 1; \
10+
fi
11+
112
.PHONY: test
213
test:
3-
@if command -v jag >/dev/null 2>&1; then \
4-
find tests -type d -name '.packages' -prune -o -type f \( -name '*_test.toit' -o -name '*.test.toit' \) -exec sh -c 'echo Running {} && jag run --device host {}' \; ; \
14+
@FAILED=0; \
15+
if command -v jag >/dev/null 2>&1; then \
16+
find tests -type d -name '.packages' -prune -o -type f \( -name '*_test.toit' -o -name '*.test.toit' \) -exec sh -c 'echo Running {} && jag run --device host {} || FAILED=1' \; ; \
517
elif command -v toit.run >/dev/null 2>&1; then \
6-
find tests -type d -name '.packages' -prune -o -type f \( -name '*_test.toit' -o -name '*.test.toit' \) -exec sh -c 'echo Running {} && toit.run {}' \; ; \
18+
find tests -type d -name '.packages' -prune -o -type f \( -name '*_test.toit' -o -name '*.test.toit' \) -exec sh -c 'echo Running {} && toit.run {} || FAILED=1' \; ; \
719
else \
820
echo "Error: Neither 'jag' nor 'toit.run' found in PATH"; \
921
exit 1; \
22+
fi; \
23+
if [ $$FAILED -ne 0 ]; then \
24+
exit 1; \
1025
fi

0 commit comments

Comments
 (0)