Skip to content

Commit 2bd25f4

Browse files
committed
Build examples in CI
1 parent ac4fe90 commit 2bd25f4

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/scripts/build-examples.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
_status=0
4+
5+
for example in $(ls examples | sed s/\.rs$//); do
6+
output=$(cargo build --target=thumbv6m-none-eabi --example=$example --color=always 2>&1)
7+
result=$?
8+
9+
if [[ $result == 0 ]]; then
10+
echo "::group::✅ $example ok"
11+
else
12+
echo "::group::💥 $example fail"
13+
_status=1
14+
fi
15+
echo "$output"
16+
echo "::endgroup::"
17+
done
18+
19+
exit $_status

.github/workflows/ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
run: cargo clippy --color=always -- -D warnings
2929

3030
- name: build
31-
run: cargo check
31+
run: cargo build --target=thumbv6m-none-eabi
32+
33+
- name: build examples
34+
run: .github/scripts/build-examples.sh
3235

3336

0 commit comments

Comments
 (0)