Skip to content

Commit a92cdd7

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

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-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: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1+
.PHONY: install
2+
install:
3+
@if command -v jag >/dev/null 2>&1; then \
4+
echo "Running 'jag pkg install'"; \
5+
jag pkg install; \
6+
elif command -v toit.pkg >/dev/null 2>&1; then \
7+
echo "Running 'toit.pkg install'"; \
8+
toit.pkg install; \
9+
else \
10+
echo "Error: Neither 'jag' nor 'toit.pkg' found in PATH"; \
11+
exit 1; \
12+
fi
13+
114
.PHONY: test
215
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 {}' \; ; \
16+
@FAILED=0; \
17+
if command -v jag >/dev/null 2>&1; then \
18+
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' \; ; \
519
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 {}' \; ; \
20+
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' \; ; \
721
else \
822
echo "Error: Neither 'jag' nor 'toit.run' found in PATH"; \
923
exit 1; \
24+
fi; \
25+
if [ $$FAILED -ne 0 ]; then \
26+
exit 1; \
1027
fi

0 commit comments

Comments
 (0)