Skip to content

Commit 722fb49

Browse files
author
doomwastaken
committed
updated timeouts and added more bash than I wanted
1 parent 8b76831 commit 722fb49

File tree

5 files changed

+88
-73
lines changed

5 files changed

+88
-73
lines changed

.github/actions/unit-test/action.yml

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,48 @@ runs:
2222
- name: Flash unit test firmware
2323
id: flashing
2424
shell: bash
25-
timeout-minutes: 5
2625
run: |
27-
source scripts/toolchain/fbtenv.sh
28-
./fbt resources firmware_latest flash LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
26+
timeout 180 bash -c '
27+
source scripts/toolchain/fbtenv.sh
28+
./fbt resources firmware_latest flash LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
29+
'
30+
echo $? > flash_result.txt
2931
3032
- name: Prepare and reboot
3133
id: copy
32-
if: steps.flashing.outcome == 'success'
34+
if: success()
3335
shell: bash
34-
timeout-minutes: 5
3536
run: |
36-
source scripts/toolchain/fbtenv.sh
37-
python3 scripts/testops.py -t=15 await_flipper
38-
python3 scripts/storage.py -f send build/latest/resources /ext
39-
python3 scripts/storage.py -f send /region_data /ext/.int/.region_data
40-
python3 scripts/power.py reboot
41-
python3 scripts/testops.py -t=30 await_flipper
37+
timeout 120 bash -c '
38+
source scripts/toolchain/fbtenv.sh
39+
python3 scripts/testops.py -t=15 await_flipper
40+
python3 scripts/storage.py -f send build/latest/resources /ext
41+
python3 scripts/storage.py -f send /region_data /ext/.int/.region_data
42+
python3 scripts/power.py reboot
43+
python3 scripts/testops.py -t=30 await_flipper
44+
'
45+
echo $? > copy_result.txt
4246
4347
- name: Run unit tests
4448
id: run_units
45-
if: steps.copy.outcome == 'success'
49+
if: success()
4650
shell: bash
47-
timeout-minutes: 5
4851
run: |
49-
source scripts/toolchain/fbtenv.sh
50-
python3 scripts/testops.py run_units
52+
timeout 360 bash -c '
53+
source scripts/toolchain/fbtenv.sh
54+
python3 scripts/testops.py run_units
55+
'
56+
echo $? > run_units_result.txt
5157
5258
- name: Upload unit test results
53-
if: failure() && steps.flashing.outcome == 'success' && steps.run_units.outcome != 'skipped'
59+
if: failure()
5460
uses: actions/upload-artifact@v4
5561
with:
5662
name: unit-tests_output
5763
path: unit_tests*.txt
5864

5965
- name: Check GDB output
60-
if: failure() && steps.flashing.outcome == 'success'
66+
if: failure()
6167
shell: bash
6268
run: |
6369
./fbt gdb_trace_all LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1
@@ -67,10 +73,9 @@ runs:
6773
shell: bash
6874
run: |
6975
echo "timed_out=false" >> $GITHUB_OUTPUT
70-
if [[ "${{ steps.flashing.outcome }}" == "failure" && "${{ steps.flashing.conclusion }}" == "timed_out" ]]; then
71-
echo "timed_out=true" >> $GITHUB_OUTPUT
72-
elif [[ "${{ steps.copy.outcome }}" == "failure" && "${{ steps.copy.conclusion }}" == "timed_out" ]]; then
73-
echo "timed_out=true" >> $GITHUB_OUTPUT
74-
elif [[ "${{ steps.run_units.outcome }}" == "failure" && "${{ steps.run_units.conclusion }}" == "timed_out" ]]; then
75-
echo "timed_out=true" >> $GITHUB_OUTPUT
76-
fi
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
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Run updater test
2+
description: Flash and validate updater firmware
3+
4+
inputs:
5+
pr_ref:
6+
required: true
7+
description: Commit SHA of the PR
8+
9+
outputs:
10+
timed_out:
11+
value: ${{ steps.set_timeout_flag.outputs.timed_out }}
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
20+
ref: ${{ inputs.pr_ref }}
21+
22+
- name: Flash full firmware
23+
id: flash
24+
shell: bash
25+
run: |
26+
timeout 180 bash -c '
27+
source scripts/toolchain/fbtenv.sh
28+
python3 scripts/testops.py -t=180 await_flipper
29+
./fbt flash_usb_full FORCE=1
30+
'
31+
echo $? > flash_result.txt
32+
33+
- name: Validate updater
34+
id: validate
35+
shell: bash
36+
run: |
37+
timeout 180 bash -c '
38+
source scripts/toolchain/fbtenv.sh
39+
python3 scripts/testops.py -t=180 await_flipper
40+
./fbt flash_usb FORCE=1
41+
python3 scripts/testops.py -t=180 await_flipper
42+
'
43+
echo $? > validate_result.txt
44+
45+
- name: Check for timeout and set output
46+
id: set_timeout_flag
47+
shell: bash
48+
run: |
49+
echo "timed_out=false" >> $GITHUB_OUTPUT
50+
51+
if [ -f flash_result.txt ] && [ "$(cat flash_result.txt)" = "124" ]; then
52+
echo "timed_out=true" >> $GITHUB_OUTPUT
53+
elif [ -f validate_result.txt ] && [ "$(cat validate_result.txt)" = "124" ]; then
54+
echo "timed_out=true" >> $GITHUB_OUTPUT
55+
fi

.github/actions/updater-tests/action.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
jobs:
66
unit_attempt_1:
77
runs-on: [self-hosted, FlipperZeroTest]
8+
timeout-minutes: 10
89
outputs:
910
timed_out: ${{ steps.run.outputs.timed_out }}
1011
steps:
@@ -21,6 +22,7 @@ jobs:
2122
needs: unit_attempt_1
2223
if: needs.unit_attempt_1.outputs.timed_out == 'true'
2324
runs-on: [self-hosted, FlipperZeroTest]
25+
timeout-minutes: 10
2426
steps:
2527
- name: Checkout repo (needed for local action discovery)
2628
uses: actions/checkout@v4

.github/workflows/updater_test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
jobs:
66
attempt1:
77
runs-on: [self-hosted, FlipperZeroTest]
8+
timeout-minutes: 8
89
outputs:
910
timed_out: ${{ steps.run.outputs.timed_out }}
1011
steps:
@@ -21,6 +22,7 @@ jobs:
2122
needs: attempt1
2223
if: needs.attempt1.outputs.timed_out == 'true'
2324
runs-on: [self-hosted, FlipperZeroTest]
25+
timeout-minutes: 8
2426
steps:
2527
- name: Checkout repo (needed for local action discovery)
2628
uses: actions/checkout@v4

0 commit comments

Comments
 (0)