Skip to content

Commit db5eed0

Browse files
authored
Merge pull request #32 from robyoung/build-examples-in-ci
Build examples in CI
2 parents ac4fe90 + ecd0d96 commit db5eed0

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
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

examples/serial_hal_blocking_echo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() -> ! {
1515
let gpio = p.GPIO.split();
1616

1717
/* Initialise serial port on the micro:bit */
18-
let (mut tx, mut rx) = microbit::serial_port(gpio, p.UART0, BAUD115200);
18+
let (mut tx, mut rx) = microbit::serial_port!(gpio, p.UART0, BAUD115200);
1919

2020
/* Print a nice hello message */
2121
let s = b"Please type characters to echo:\r\n";

0 commit comments

Comments
 (0)