CI: Run on main and on request in addition to pull requests #159
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ideally this should be replaced with a call out to Murdock; until that is | ||
# practical, building representative examples. | ||
name: build-test | ||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
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: Pull cargo updates | ||
run: | | ||
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 | ||
- name: Build on selected platforms | ||
strategy: | ||
Check failure on line 38 in .github/workflows/buildtest.yml GitHub Actions / build-testInvalid workflow file
|
||
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 }} | ||
- name: Build and run tests | ||
strategy: | ||
matrix: | ||
board: [native sltb001a samr21-xpro stk3700] | ||
run: | | ||
DIRS=$(echo tests/*/) | ||
export RIOTBASE=$(pwd)/RIOT | ||
# It appears that there has to be output before :: commands really catch on | ||
echo "Building ${DIRS} on ${{ matrix.board }}" | ||
echo "::echo ::on" | ||
for D in ${DIRS}; do | ||
cd ${D} | ||
echo "::group::Building ${D}" | ||
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" |