-
Notifications
You must be signed in to change notification settings - Fork 10
78 lines (75 loc) · 2.67 KB
/
buildtest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Ideally this should be replaced with a call out to Murdock; until that is
# practical, building representative examples.
name: build-test
on:
pull_request:
branches:
- '*'
jobs:
build-test:
runs-on: ubuntu-latest
container: riot/riotbuild
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: RIOT-OS/RIOT
path: RIOT
- name: Patch .cargo/config.toml to use current checkout
run: |
cd RIOT
rm -f .cargo/config.toml
mkdir -p .cargo # Keep working if RIOT ever decides it doesn't need overrides any more
echo '[patch.crates-io]' >> .cargo/config.toml
echo 'riot-wrappers = { path = "../", version = "*" }' >> .cargo/config.toml
echo 'riot-sys = { git = "https://github.com/RIOT-OS/rust-riot-sys" }' >> .cargo/config.toml
- name: Build on selected platforms
# not going with a
#
# strategy:
# matrix:
# example: [examples/rust-hello-world examples/rust-gcoap tests/rust_minimal]
#
# setup here because really most of the stuff is the same, and the `cargo
# update` is much faster the second time (so a parallel execution may
# still be faster but uses 3x the resources)
run: |
export BOARDS='native sltb001a samr21-xpro stk3700'
DIRS='examples/rust-hello-world examples/rust-gcoap tests/rust_minimal'
# It appears that there has to be output before :: commands really catch on
echo "Building ${DIRS} on ${BOARDS}"
echo "::echo ::on"
cd RIOT
for D in ${DIRS}; do
cd ${D}
echo "::group::Building ${D}"
cargo update -p riot-sys -p riot-wrappers --aggressive
cargo tree
make buildtest BUILDTEST_MAKE_REDIRECT=''
cd ../..
echo "::endgroup::"
done
cd ..
echo "::echo ::off"
- name: Build and run tests
run: |
export BOARDS='native sltb001a samr21-xpro stk3700'
DIRS=$(echo tests/*/)
export RIOTBASE=$(pwd)/RIOT
# It appears that there has to be output before :: commands really catch on
echo "Building ${DIRS} on ${BOARDS}"
echo "::echo ::on"
for D in ${DIRS}; do
cd ${D}
echo "::group::Building ${D}"
cargo update -p riot-sys -p riot-wrappers --aggressive
make buildtest BUILDTEST_MAKE_REDIRECT=''
echo "::endgroup::"
if make test/available BOARD=native; then
echo "::group::Testing ${D}"
make all test BOARD=native
echo "::endgroup::"
fi
cd ../..
done
echo "::echo ::off"