Skip to content

Commit

Permalink
CI: Split update and build, run in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Nov 24, 2023
1 parent eff6b79 commit 4f218c3
Showing 1 changed file with 25 additions and 30 deletions.
55 changes: 25 additions & 30 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

jobs:
build-test:
prepare:
runs-on: ubuntu-latest
container: riot/riotbuild
steps:
Expand All @@ -27,46 +27,41 @@ jobs:
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)
- name: Pull cargo updates
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::"
for MANIF in $(find -name Cargo.toml)
do
cargo update -p riot-os -p riot-wrappers --aggressive --manifest-path $MANIF
cargo tree --manifest-path $MANIF
done
cd ..
echo "::echo ::off"
build-examples:
needs: prepare
steps:
- name: Build on selected platforms
strategy:
matrix:
example: [examples/rust-hello-world examples/rust-gcoap tests/rust_minimal]
board: [native sltb001a samr32-xpro stk3700]
run: |
make buildtest BUILDTEST_MAKE_REDIRECT='' BOARD=${{ matrix.board }} -C ${{ matrix.example }}
build-tests:
needs: prepare
steps:
- name: Build and run tests
strategy:
matrix:
board: [native sltb001a samr21-xpro stk3700]
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 "Building ${DIRS} on ${{ matrix.board }}"
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
Expand Down

0 comments on commit 4f218c3

Please sign in to comment.