ci(wokwi): Self host Wokwi CLI server (#9701)
* ci(wokwi): Self host Wokwi CLI server * ci(event_file): Fix file upload * change(tests): Re-run once on test failure
This commit is contained in:
parent
3925d51839
commit
d45f35a2c8
3 changed files with 19 additions and 12 deletions
12
.github/scripts/tests_run.sh
vendored
12
.github/scripts/tests_run.sh
vendored
|
|
@ -7,6 +7,7 @@ function run_test() {
|
||||||
local erase_flash=$4
|
local erase_flash=$4
|
||||||
local sketchdir=$(dirname $sketch)
|
local sketchdir=$(dirname $sketch)
|
||||||
local sketchname=$(basename $sketchdir)
|
local sketchname=$(basename $sketchdir)
|
||||||
|
local result=0
|
||||||
|
|
||||||
if [[ -f "$sketchdir/.skip.$platform" ]] || [[ -f "$sketchdir/.skip.$target" ]] || [[ -f "$sketchdir/.skip.$platform.$target" ]]; then
|
if [[ -f "$sketchdir/.skip.$platform" ]] || [[ -f "$sketchdir/.skip.$target" ]] || [[ -f "$sketchdir/.skip.$platform.$target" ]]; then
|
||||||
echo "Skipping $sketchname test for $target, platform: $platform"
|
echo "Skipping $sketchname test for $target, platform: $platform"
|
||||||
|
|
@ -61,11 +62,18 @@ function run_test() {
|
||||||
extra_args="--embedded-services esp,arduino"
|
extra_args="--embedded-services esp,arduino"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
result=0
|
||||||
echo "pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args"
|
echo "pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args"
|
||||||
bash -c "pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args"
|
bash -c "set +e; pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args; exit \$?" || result=$?
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result -ne 0 ]; then
|
if [ $result -ne 0 ]; then
|
||||||
return $result
|
result=0
|
||||||
|
echo "Retrying test: $sketchname -- Config: $i"
|
||||||
|
bash -c "set +e; pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args; exit \$?" || result=$?
|
||||||
|
result=$?
|
||||||
|
if [ $result -ne 0 ]; then
|
||||||
|
exit $result
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
.github/workflows/hil.yml
vendored
16
.github/workflows/hil.yml
vendored
|
|
@ -59,6 +59,12 @@ jobs:
|
||||||
echo "test_folder=${test_folder}" >> $GITHUB_OUTPUT
|
echo "test_folder=${test_folder}" >> $GITHUB_OUTPUT
|
||||||
echo "test_type=${test_type}" >> $GITHUB_OUTPUT
|
echo "test_type=${test_type}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Upload Event file
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: event_file
|
||||||
|
path: ${{github.event_path}}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: gen_chunks
|
needs: gen_chunks
|
||||||
name: ${{matrix.chip}}-Build#${{matrix.chunks}}
|
name: ${{matrix.chip}}-Build#${{matrix.chunks}}
|
||||||
|
|
@ -267,13 +273,3 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
tests/**/*.xml
|
tests/**/*.xml
|
||||||
tests/**/result_*.json
|
tests/**/result_*.json
|
||||||
|
|
||||||
event_file:
|
|
||||||
name: "Event File"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: event_file
|
|
||||||
path: ${{github.event_path}}
|
|
||||||
|
|
|
||||||
3
.github/workflows/wokwi.yml
vendored
3
.github/workflows/wokwi.yml
vendored
|
|
@ -95,6 +95,9 @@ jobs:
|
||||||
- name: Install Wokwi CLI
|
- name: Install Wokwi CLI
|
||||||
run: curl -L https://wokwi.com/ci/install.sh | sh
|
run: curl -L https://wokwi.com/ci/install.sh | sh
|
||||||
|
|
||||||
|
- name: Wokwi CI Server
|
||||||
|
uses: wokwi/wokwi-ci-server-action@v1
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install -U pip
|
pip install -U pip
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue