ci(hw): Fix files being overwritten (#11019)
Co-authored-by: Sugar Glider <rodrigo.garcia@espressif.com> Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
This commit is contained in:
parent
07d6a5a0d2
commit
c2b0482511
7 changed files with 36 additions and 26 deletions
4
.github/scripts/sketch_utils.sh
vendored
4
.github/scripts/sketch_utils.sh
vendored
|
|
@ -244,7 +244,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
|
||||||
build_dir="$ARDUINO_BUILD_DIR"
|
build_dir="$ARDUINO_BUILD_DIR"
|
||||||
elif [ "$len" -eq 1 ]; then
|
elif [ "$len" -eq 1 ]; then
|
||||||
# build_dir="$sketchdir/build"
|
# build_dir="$sketchdir/build"
|
||||||
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
|
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output_file="$HOME/.arduino/cli_compile_output.txt"
|
output_file="$HOME/.arduino/cli_compile_output.txt"
|
||||||
|
|
@ -254,7 +254,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
|
||||||
for i in $(seq 0 $((len - 1))); do
|
for i in $(seq 0 $((len - 1))); do
|
||||||
if [ "$len" -ne 1 ]; then
|
if [ "$len" -ne 1 ]; then
|
||||||
# build_dir="$sketchdir/build$i"
|
# build_dir="$sketchdir/build$i"
|
||||||
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
|
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
|
||||||
fi
|
fi
|
||||||
rm -rf "$build_dir"
|
rm -rf "$build_dir"
|
||||||
mkdir -p "$build_dir"
|
mkdir -p "$build_dir"
|
||||||
|
|
|
||||||
10
.github/scripts/tests_run.sh
vendored
10
.github/scripts/tests_run.sh
vendored
|
|
@ -27,9 +27,9 @@ function run_test {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$len" -eq 1 ]; then
|
if [ "$len" -eq 1 ]; then
|
||||||
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build.tmp/sdkconfig"
|
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build.tmp/sdkconfig"
|
||||||
else
|
else
|
||||||
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build0.tmp/sdkconfig"
|
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build0.tmp/sdkconfig"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$sketchdir"/ci.json ]; then
|
if [ -f "$sketchdir"/ci.json ]; then
|
||||||
|
|
@ -45,7 +45,7 @@ function run_test {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$sdkconfig_path" ]; then
|
if [ ! -f "$sdkconfig_path" ]; then
|
||||||
printf "\033[93mSketch %s not built\nMight be due to missing target requirements or build failure\033[0m\n" "$sketchname"
|
printf "\033[93mSketch %s build not found in %s\nMight be due to missing target requirements or build failure\033[0m\n" "$(dirname "$sdkconfig_path")" "$sketchname"
|
||||||
printf "\n\n\n"
|
printf "\n\n\n"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
@ -60,7 +60,7 @@ function run_test {
|
||||||
|
|
||||||
if [ "$len" -eq 1 ]; then
|
if [ "$len" -eq 1 ]; then
|
||||||
# build_dir="$sketchdir/build"
|
# build_dir="$sketchdir/build"
|
||||||
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
|
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
|
||||||
report_file="$sketchdir/$target/$sketchname.xml"
|
report_file="$sketchdir/$target/$sketchname.xml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ function run_test {
|
||||||
|
|
||||||
if [ "$len" -ne 1 ]; then
|
if [ "$len" -ne 1 ]; then
|
||||||
# build_dir="$sketchdir/build$i"
|
# build_dir="$sketchdir/build$i"
|
||||||
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
|
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
|
||||||
report_file="$sketchdir/$target/$sketchname$i.xml"
|
report_file="$sketchdir/$target/$sketchname$i.xml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
24
.github/workflows/tests_build.yml
vendored
24
.github/workflows/tests_build.yml
vendored
|
|
@ -26,10 +26,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
key: tests-${{ env.id }}-bin
|
key: tests-${{ env.id }}-bin
|
||||||
path: |
|
path: |
|
||||||
~/.arduino/tests/**/build*.tmp/*.bin
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
|
||||||
~/.arduino/tests/**/build*.tmp/*.elf
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
|
||||||
~/.arduino/tests/**/build*.tmp/*.json
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
|
||||||
~/.arduino/tests/**/build*.tmp/sdkconfig
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig
|
||||||
|
|
||||||
- name: Evaluate if tests should be built
|
- name: Evaluate if tests should be built
|
||||||
id: check-build
|
id: check-build
|
||||||
|
|
@ -73,10 +73,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
key: tests-${{ env.id }}-bin
|
key: tests-${{ env.id }}-bin
|
||||||
path: |
|
path: |
|
||||||
~/.arduino/tests/**/build*.tmp/*.bin
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
|
||||||
~/.arduino/tests/**/build*.tmp/*.elf
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
|
||||||
~/.arduino/tests/**/build*.tmp/*.json
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
|
||||||
~/.arduino/tests/**/build*.tmp/sdkconfig
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig
|
||||||
|
|
||||||
- name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as artifacts
|
- name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
@ -84,7 +84,7 @@ jobs:
|
||||||
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
|
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
path: |
|
path: |
|
||||||
~/.arduino/tests/**/build*.tmp/*.bin
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
|
||||||
~/.arduino/tests/**/build*.tmp/*.elf
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
|
||||||
~/.arduino/tests/**/build*.tmp/*.json
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
|
||||||
~/.arduino/tests/**/build*.tmp/sdkconfig
|
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig
|
||||||
|
|
|
||||||
16
.github/workflows/tests_hw.yml
vendored
16
.github/workflows/tests_hw.yml
vendored
|
|
@ -22,13 +22,18 @@ defaults:
|
||||||
jobs:
|
jobs:
|
||||||
hardware-test:
|
hardware-test:
|
||||||
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests
|
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests
|
||||||
runs-on: [arduino, "${{ inputs.chip }}"]
|
runs-on: ["arduino", "${{ inputs.chip }}"]
|
||||||
env:
|
env:
|
||||||
id: ${{ github.event.pull_request.number || github.ref }}-${{ github.event.pull_request.head.sha || github.sha }}-${{ inputs.chip }}-${{ inputs.type }}
|
id: ${{ github.event.pull_request.number || github.ref }}-${{ github.event.pull_request.head.sha || github.sha }}-${{ inputs.chip }}-${{ inputs.type }}
|
||||||
container:
|
container:
|
||||||
image: python:3.10.1-bullseye
|
image: python:3.10.1-bullseye
|
||||||
options: --privileged
|
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Clean workspace
|
||||||
|
run: |
|
||||||
|
rm -rf ./*
|
||||||
|
rm -rf ~/.arduino/tests
|
||||||
|
|
||||||
- name: Check if already passed
|
- name: Check if already passed
|
||||||
id: cache-results
|
id: cache-results
|
||||||
if: github.event.pull_request.number != null
|
if: github.event.pull_request.number != null
|
||||||
|
|
@ -81,7 +86,12 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
|
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
|
||||||
path: |
|
path: |
|
||||||
~/.arduino/tests
|
~/.arduino/tests/${{ inputs.chip }}
|
||||||
|
|
||||||
|
- name: List binaries
|
||||||
|
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
||||||
|
run: |
|
||||||
|
ls -laR ~/.arduino/tests
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
||||||
|
|
|
||||||
2
.github/workflows/tests_qemu.yml
vendored
2
.github/workflows/tests_qemu.yml
vendored
|
|
@ -117,7 +117,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
|
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
|
||||||
path: |
|
path: |
|
||||||
~/.arduino/tests
|
~/.arduino/tests/${{ inputs.chip }}
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
||||||
|
|
|
||||||
2
.github/workflows/tests_wokwi.yml
vendored
2
.github/workflows/tests_wokwi.yml
vendored
|
|
@ -276,7 +276,7 @@ jobs:
|
||||||
run-id: ${{ github.event.workflow_run.id }}
|
run-id: ${{ github.event.workflow_run.id }}
|
||||||
name: tests-bin-${{ matrix.chip }}-${{ matrix.type }}
|
name: tests-bin-${{ matrix.chip }}-${{ matrix.type }}
|
||||||
path: |
|
path: |
|
||||||
~/.arduino/tests
|
~/.arduino/tests/${{ matrix.chip }}
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
||||||
|
|
|
||||||
|
|
@ -318,7 +318,7 @@ ESP32-C3 target, you would run:
|
||||||
|
|
||||||
./.github/scripts/tests_build.sh -s uart -t esp32c3
|
./.github/scripts/tests_build.sh -s uart -t esp32c3
|
||||||
|
|
||||||
You should see the output of the build process and the test binary should be generated in the ``~/.arduino/tests/<test_name>/build.tmp`` folder.
|
You should see the output of the build process and the test binary should be generated in the ``~/.arduino/tests/<target_chip>/<test_name>/build.tmp`` folder.
|
||||||
|
|
||||||
Now that the test is built, you can run it in the target board. Connect the target board to your computer and run:
|
Now that the test is built, you can run it in the target board. Connect the target board to your computer and run:
|
||||||
|
|
||||||
|
|
@ -339,7 +339,7 @@ The test will run on the target board and you should see the output of the test
|
||||||
lucassvaz@Lucas--MacBook-Pro esp32 % ./.github/scripts/tests_run.sh -s uart -t esp32c3
|
lucassvaz@Lucas--MacBook-Pro esp32 % ./.github/scripts/tests_run.sh -s uart -t esp32c3
|
||||||
Sketch uart test type: validation
|
Sketch uart test type: validation
|
||||||
Running test: uart -- Config: Default
|
Running test: uart -- Config: Default
|
||||||
pytest tests --build-dir /Users/lucassvaz/.arduino/tests/uart/build.tmp -k test_uart --junit-xml=/Users/lucassvaz/Espressif/Arduino/hardware/espressif/esp32/tests/validation/uart/esp32c3/uart.xml --embedded-services esp,arduino
|
pytest tests --build-dir /Users/lucassvaz/.arduino/tests/esp32c3/uart/build.tmp -k test_uart --junit-xml=/Users/lucassvaz/Espressif/Arduino/hardware/espressif/esp32/tests/validation/uart/esp32c3/uart.xml --embedded-services esp,arduino
|
||||||
=============================================================================================== test session starts ================================================================================================
|
=============================================================================================== test session starts ================================================================================================
|
||||||
platform darwin -- Python 3.12.3, pytest-8.2.2, pluggy-1.5.0
|
platform darwin -- Python 3.12.3, pytest-8.2.2, pluggy-1.5.0
|
||||||
rootdir: /Users/lucassvaz/Espressif/Arduino/hardware/espressif/esp32/tests
|
rootdir: /Users/lucassvaz/Espressif/Arduino/hardware/espressif/esp32/tests
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue