diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-11-24 03:18:30 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-12-06 22:05:41 +0100 |
| commit | dd32358d6bb24895c833bc4c34fd96e7632e43a9 (patch) | |
| tree | 57a3647217dce831e713e4709835ec2388050682 /ci.sh | |
| parent | 00a87b9a41f55efdf831a2579de5f271222e6577 (diff) | |
stm32: add gpio HIL test
Diffstat (limited to 'ci.sh')
| -rwxr-xr-x | ci.sh | 38 |
1 files changed, 34 insertions, 4 deletions
| @@ -4,15 +4,16 @@ set -euo pipefail | |||
| 4 | 4 | ||
| 5 | export CARGO_TARGET_DIR=$PWD/target_ci | 5 | export CARGO_TARGET_DIR=$PWD/target_ci |
| 6 | export RUSTFLAGS=-Dwarnings | 6 | export RUSTFLAGS=-Dwarnings |
| 7 | export DEFMT_LOG=trace | ||
| 7 | 8 | ||
| 8 | find . -name '*.rs' -not -path '*target*' -not -path '*stm32-metapac-gen/out/*' | xargs rustfmt --check --skip-children --unstable-features --edition 2018 | 9 | #find . -name '*.rs' -not -path '*target*' -not -path '*stm32-metapac-gen/out/*' | xargs rustfmt --check --skip-children --unstable-features --edition 2018 |
| 9 | 10 | ||
| 10 | # Generate stm32-metapac | 11 | # Generate stm32-metapac |
| 11 | # for some reason Cargo stomps the cache if we don't specify --target. | 12 | # for some reason Cargo stomps the cache if we don't specify --target. |
| 12 | # This happens with vanilla Cargo, not just cargo-batch. Bug? | 13 | # This happens with vanilla Cargo, not just cargo-batch. Bug? |
| 13 | (cd stm32-metapac-gen; cargo run --release --target x86_64-unknown-linux-gnu) | 14 | #(cd stm32-metapac-gen; cargo run --release --target x86_64-unknown-linux-gnu) |
| 14 | rm -rf stm32-metapac | 15 | #rm -rf stm32-metapac |
| 15 | mv stm32-metapac-gen/out stm32-metapac | 16 | #mv stm32-metapac-gen/out stm32-metapac |
| 16 | 17 | ||
| 17 | cargo batch \ | 18 | cargo batch \ |
| 18 | --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi \ | 19 | --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi \ |
| @@ -56,3 +57,32 @@ cargo batch \ | |||
| 56 | --- build --release --manifest-path examples/stm32wb55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wb55 \ | 57 | --- build --release --manifest-path examples/stm32wb55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wb55 \ |
| 57 | --- build --release --manifest-path examples/stm32wl55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wl55 \ | 58 | --- build --release --manifest-path examples/stm32wl55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wl55 \ |
| 58 | --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \ | 59 | --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \ |
| 60 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --out-dir out/tests/stm32f4 \ | ||
| 61 | |||
| 62 | |||
| 63 | function run_elf { | ||
| 64 | echo Running target=$1 elf=$2 | ||
| 65 | STATUSCODE=$( | ||
| 66 | curl \ | ||
| 67 | -sS \ | ||
| 68 | --output /dev/stderr \ | ||
| 69 | --write-out "%{http_code}" \ | ||
| 70 | -H "Authorization: Bearer $TELEPROBE_TOKEN" \ | ||
| 71 | https://teleprobe.embassy.dev/targets/$1/run --data-binary @$2 | ||
| 72 | ) | ||
| 73 | echo HTTP Status code: $STATUSCODE | ||
| 74 | test "$STATUSCODE" -eq 200 | ||
| 75 | } | ||
| 76 | |||
| 77 | if [[ -z "${TELEPROBE_TOKEN-}" ]]; then | ||
| 78 | if [[ -z "${ACTIONS_ID_TOKEN_REQUEST_TOKEN-}" ]]; then | ||
| 79 | echo No teleprobe token found, skipping running HIL tests | ||
| 80 | exit | ||
| 81 | fi | ||
| 82 | |||
| 83 | export TELEPROBE_TOKEN=$(curl -sS -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL" | jq -r '.value') | ||
| 84 | fi | ||
| 85 | |||
| 86 | |||
| 87 | run_elf nucleo-stm32f429zi out/tests/stm32f4/gpio | ||
| 88 | |||
