Skip to content

Commit 2e4ed1f

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

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515

1616
- uses: toitlang/action-setup@v1
1717
with:
18-
toit-version: 'v2.0.0-alpha.120'
18+
toit-version: 'v2.0.0-alpha.150'
1919

2020
- run: make test

Makefile

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1-
.PHONY: test
2-
test:
1+
.PHONY: install
2+
install:
33
@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 {}' \; ; \
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+
14+
.PHONY: test
15+
test: install-tests
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; \
10-
fi
24+
fi; \
25+
if [ $$FAILED -ne 0 ]; then \
26+
exit 1; \
27+
fi
28+
29+
.PHONY: install-tests
30+
install-tests:
31+
@cd tests && $(MAKE) install

tests/package.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
sdk: ^2.0.0-alpha.150
12
prefixes:
23
coordinate: toit-coordinate
34
lightbug: ..
@@ -6,6 +7,12 @@ packages:
67
path: ..
78
prefixes:
89
coordinate: toit-coordinate
10+
http: pkg-http
11+
pkg-http:
12+
url: github.com/toitlang/pkg-http
13+
name: http
14+
version: 2.9.0
15+
hash: ed6e198259c578154de830dc492821fdb5a40c7a
916
toit-coordinate:
1017
url: github.com/lightbug-io/toit-coordinate
1118
name: coordinate

0 commit comments

Comments
 (0)