2022-10-28 16:59:09 +03:00
|
|
|
name: 'Unit tests'
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
TARGETS: f7
|
|
|
|
DEFAULT_TARGET: f7
|
2022-12-19 16:07:23 +03:00
|
|
|
FBT_TOOLCHAIN_PATH: /opt
|
2022-10-28 16:59:09 +03:00
|
|
|
|
|
|
|
jobs:
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
run_units_on_bench:
|
2023-02-25 15:05:02 +03:00
|
|
|
runs-on: [self-hosted, FlipperZeroUnitTest]
|
2022-10-28 16:59:09 +03:00
|
|
|
steps:
|
2023-03-22 14:26:40 +03:00
|
|
|
- name: 'Wipe workspace'
|
2023-04-28 17:25:20 +03:00
|
|
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
2022-12-10 23:34:12 +03:00
|
|
|
|
2022-10-28 16:59:09 +03:00
|
|
|
- name: Checkout code
|
2022-12-10 16:10:51 +03:00
|
|
|
uses: actions/checkout@v3
|
2022-10-28 16:59:09 +03:00
|
|
|
with:
|
2023-03-15 18:24:56 +03:00
|
|
|
fetch-depth: 1
|
2022-10-28 16:59:09 +03:00
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
|
|
|
|
- name: 'Get flipper from device manager (mock)'
|
|
|
|
id: device
|
|
|
|
run: |
|
|
|
|
echo "flipper=/dev/ttyACM0" >> $GITHUB_OUTPUT
|
|
|
|
|
2022-11-02 18:21:43 +03:00
|
|
|
- name: 'Flash unit tests firmware'
|
|
|
|
id: flashing
|
2022-12-19 16:07:23 +03:00
|
|
|
if: success()
|
2023-06-27 23:47:13 +03:00
|
|
|
timeout-minutes: 5
|
2023-03-21 12:55:20 +03:00
|
|
|
run: |
|
2022-12-19 16:07:23 +03:00
|
|
|
./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|
2022-10-28 16:59:09 +03:00
|
|
|
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
- name: 'Wait for flipper and format ext'
|
|
|
|
id: format_ext
|
2022-11-02 18:21:43 +03:00
|
|
|
if: steps.flashing.outcome == 'success'
|
2023-06-27 23:47:13 +03:00
|
|
|
timeout-minutes: 5
|
2022-10-28 16:59:09 +03:00
|
|
|
run: |
|
2022-12-19 16:07:23 +03:00
|
|
|
source scripts/toolchain/fbtenv.sh
|
|
|
|
python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
|
2022-10-28 16:59:09 +03:00
|
|
|
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
- name: 'Copy assets and unit data, reboot and wait for flipper'
|
2022-10-28 16:59:09 +03:00
|
|
|
id: copy
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
if: steps.format_ext.outcome == 'success'
|
2023-06-27 23:47:13 +03:00
|
|
|
timeout-minutes: 3
|
2022-10-28 16:59:09 +03:00
|
|
|
run: |
|
2022-12-19 16:07:23 +03:00
|
|
|
source scripts/toolchain/fbtenv.sh
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/resources /ext
|
2022-12-19 16:07:23 +03:00
|
|
|
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/unit_tests /ext/unit_tests
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
python3 scripts/power.py -p ${{steps.device.outputs.flipper}} reboot
|
|
|
|
python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
|
2022-10-28 16:59:09 +03:00
|
|
|
|
|
|
|
- name: 'Run units and validate results'
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
id: run_units
|
2022-10-28 16:59:09 +03:00
|
|
|
if: steps.copy.outcome == 'success'
|
2023-06-27 23:47:13 +03:00
|
|
|
timeout-minutes: 5
|
2022-10-28 16:59:09 +03:00
|
|
|
run: |
|
2022-12-19 16:07:23 +03:00
|
|
|
source scripts/toolchain/fbtenv.sh
|
|
|
|
python3 scripts/testing/units.py ${{steps.device.outputs.flipper}}
|
|
|
|
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
- name: 'Check GDB output'
|
|
|
|
if: failure()
|
2022-12-19 16:07:23 +03:00
|
|
|
run: |
|
Splitting units and updater benches (#2165)
* test run, moved updated to separate physical runner/flipper/card
* simplified units, removed re-flashing, moved format to beginning of run
* added reboot requence and mini optimizations
* forgot gitadd, added script modifications, workflow changes
* fixed linter issues
* moved updater to unit bench for speed up
* changes to units, flash (not full) on second update, new fbt GDB thread check
* changed serial of second device
* testing pipelines, added failing unit test
* fixed gdb step
* fixed gdb step v2 electric boogaloo
* fixed gdb step v3, fixed target
* reverted while1 in units, tests complete
* testing colored output
* trying different term setting
* debug outputs for terminal
* fixed typo in SConstruct and another terminal test
* reverted changes, no colored output, for production
* fixed log output to readable format
* fixed linter
Co-authored-by: Konstantin Volkov <k.volkov@flipperdevices.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-12-28 17:16:06 +03:00
|
|
|
./fbt gdb_trace_all OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|