From 4e459df75c0534584ccc481ca2c4f00d657bd151 Mon Sep 17 00:00:00 2001 From: Juraj Michalek Date: Mon, 22 Jan 2024 06:50:04 +0100 Subject: [PATCH] ci: upload bin and txt to relase --- .../build-rust-no_std-hello-world.yaml | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-rust-no_std-hello-world.yaml b/.github/workflows/build-rust-no_std-hello-world.yaml index 80c73f5..9d6f47c 100644 --- a/.github/workflows/build-rust-no_std-hello-world.yaml +++ b/.github/workflows/build-rust-no_std-hello-world.yaml @@ -74,7 +74,9 @@ jobs: # Upload loop for each binary cd ${PROJECT}/examples/rust/no_std/hello-world for TARGET in esp32; do - OUTPUT_BIN="rust-no_std-hello-world-${TARGET}-${{ github.event.inputs.release_tag }}.bin" + OUTPUT_PREFIX="rust-no_std-hello-world-${TARGET}-${{ github.event.inputs.release_tag }}" + OUTPUT_BIN="${OUTPUT_PREFIX}.bin" + OUTPUT_TXT="${OUTPUT_PREFIX}.txt" # If TARGET is a substring in SKIP_PROJECTS, skip it #if echo "${{ github.event.inputs.skip_projects }}" | grep -q "${TARGET}"; then @@ -90,15 +92,16 @@ jobs: # Using alias from .cargo/config.toml cargo "save-image-${TARGET}" --release --merge --skip-padding ${OUTPUT_BIN} - # If skip-wokwi-test.toml exists, skip Wokwi test - #if [ -f "skip-wokwi-test.toml" ]; then - # echo "Skipping Wokwi test for $TARGET" - #else - /home/esp/bin/wokwi-cli --timeout 5000 --timeout-exit-code 0 --screenshot-time 5000 "." - #fi + # Run Wokwi test + /home/esp/bin/wokwi-cli --timeout 5000 \ + --timeout-exit-code 0 \ + --serial-log-file ${OUTPUT_TXT} \ + "." + + cat ${OUTPUT_TXT} - asset_path="/home/esp/${PROJECT}/target/xtensa-esp32-none-elf/release/hello-world" - #asset_path="/home/esp/${PROJECT}/${OUTPUT_BIN}" + # Upload binary + asset_path="/home/esp/${PROJECT}/${OUTPUT_BIN}" asset_name="${OUTPUT_BIN}" curl \ --request POST \ @@ -107,6 +110,16 @@ jobs: --data-binary "@$asset_path" \ --url "${{ needs.get_release.outputs.upload_url }}?name=${asset_name}" + # Upload log + asset_path="/home/esp/${PROJECT}/${OUTPUT_TXT}" + asset_name="${OUTPUT_TXT}" + curl \ + --request POST \ + --header "authorization: Bearer $GITHUB_TOKEN" \ + --header "Content-Type: application/octet-stream" \ + --data-binary "@$asset_path" \ + --url "${{ needs.get_release.outputs.upload_url }}?name=${asset_name}" + # If skip-wokwi-test.toml exists, skip Wokwi test #if [ ! -f "skip-wokwi-test.toml" ]; then # asset_path="/home/esp/project/${TARGET}/screenshot.png"