@@ -8,30 +8,37 @@ inputs:
88
99outputs :
1010 timed_out :
11- value : ${{ steps.check_timeout .outputs.timed_out }}
11+ value : ${{ steps.set_flag .outputs.timed_out }}
1212
1313runs :
1414 using : " composite"
1515 steps :
16+ - name : Set default timeout flag
17+ id : set_flag
18+ shell : bash
19+ run : echo "timed_out=false" >> $GITHUB_OUTPUT
20+
1621 - name : Checkout code
1722 uses : actions/checkout@v4
1823 with :
1924 fetch-depth : 1
2025 ref : ${{ inputs.pr_ref }}
2126
2227 - name : Flash unit test firmware
23- id : flashing
2428 shell : bash
2529 run : |
26- timeout 180 bash -c '
30+ timeout 240 bash -c '
2731 source scripts/toolchain/fbtenv.sh
2832 ./fbt resources firmware_latest flash LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
2933 '
30- echo $? > flash_result.txt
34+ CODE=$?
35+ if [ "$CODE" = "124" ]; then
36+ echo "timed_out=true" >> $GITHUB_OUTPUT
37+ echo "::error::Flash step timed out"
38+ exit 1
39+ fi
3140
3241 - name : Prepare and reboot
33- id : copy
34- if : success()
3542 shell : bash
3643 run : |
3744 timeout 120 bash -c '
@@ -42,18 +49,26 @@ runs:
4249 python3 scripts/power.py reboot
4350 python3 scripts/testops.py -t=30 await_flipper
4451 '
45- echo $? > copy_result.txt
52+ CODE=$?
53+ if [ "$CODE" = "124" ]; then
54+ echo "timed_out=true" >> $GITHUB_OUTPUT
55+ echo "::error::Copy step timed out"
56+ exit 1
57+ fi
4658
4759 - name : Run unit tests
48- id : run_units
49- if : success()
5060 shell : bash
5161 run : |
5262 timeout 360 bash -c '
5363 source scripts/toolchain/fbtenv.sh
5464 python3 scripts/testops.py run_units
5565 '
56- echo $? > run_units_result.txt
66+ CODE=$?
67+ if [ "$CODE" = "124" ]; then
68+ echo "timed_out=true" >> $GITHUB_OUTPUT
69+ echo "::error::Run step timed out"
70+ exit 1
71+ fi
5772
5873 - name : Upload unit test results
5974 if : failure()
6782 shell : bash
6883 run : |
6984 ./fbt gdb_trace_all LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
70-
71- - name : Check for timeout
72- id : check_timeout
73- shell : bash
74- run : |
75- echo "timed_out=false" >> $GITHUB_OUTPUT
76- for file in flash_result.txt copy_result.txt run_units_result.txt; do
77- if [ -f "$file" ] && [ "$(cat $file)" = "124" ]; then
78- echo "timed_out=true" >> $GITHUB_OUTPUT
79- break
80- fi
81- done
0 commit comments