2022-10-28 13:59:09 +00:00
|
|
|
name: 'Unit tests'
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
TARGETS: f7
|
|
|
|
DEFAULT_TARGET: f7
|
2022-12-19 13:07:23 +00:00
|
|
|
FBT_TOOLCHAIN_PATH: /opt
|
2022-10-28 13:59:09 +00: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 14:16:06 +00:00
|
|
|
run_units_on_bench:
|
2023-02-25 12:05:02 +00:00
|
|
|
runs-on: [self-hosted, FlipperZeroUnitTest]
|
2022-10-28 13:59:09 +00:00
|
|
|
steps:
|
2023-03-22 11:26:40 +00:00
|
|
|
- name: 'Wipe workspace'
|
|
|
|
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
|
2022-12-10 20:34:12 +00:00
|
|
|
|
2022-10-28 13:59:09 +00:00
|
|
|
- name: Checkout code
|
2022-12-10 13:10:51 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-10-28 13:59:09 +00:00
|
|
|
with:
|
2023-03-15 15:24:56 +00:00
|
|
|
fetch-depth: 1
|
2022-10-28 13:59:09 +00: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 15:21:43 +00:00
|
|
|
- name: 'Flash unit tests firmware'
|
|
|
|
id: flashing
|
2022-12-19 13:07:23 +00:00
|
|
|
if: success()
|
2023-03-21 09:55:20 +00:00
|
|
|
run: |
|
2022-12-19 13:07:23 +00:00
|
|
|
./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|
2022-10-28 13:59:09 +00: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 14:16:06 +00:00
|
|
|
- name: 'Wait for flipper and format ext'
|
|
|
|
id: format_ext
|
2022-11-02 15:21:43 +00:00
|
|
|
if: steps.flashing.outcome == 'success'
|
2022-10-28 13:59:09 +00:00
|
|
|
run: |
|
2022-12-19 13:07:23 +00: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 14:16:06 +00:00
|
|
|
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
|
2022-10-28 13:59:09 +00: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 14:16:06 +00:00
|
|
|
- name: 'Copy assets and unit data, reboot and wait for flipper'
|
2022-10-28 13:59:09 +00: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 14:16:06 +00:00
|
|
|
if: steps.format_ext.outcome == 'success'
|
2022-10-28 13:59:09 +00:00
|
|
|
run: |
|
2022-12-19 13:07:23 +00: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 14:16:06 +00:00
|
|
|
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/resources /ext
|
2022-12-19 13:07:23 +00: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 14:16:06 +00:00
|
|
|
python3 scripts/power.py -p ${{steps.device.outputs.flipper}} reboot
|
|
|
|
python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
|
2022-10-28 13:59:09 +00: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 14:16:06 +00:00
|
|
|
id: run_units
|
2022-10-28 13:59:09 +00:00
|
|
|
if: steps.copy.outcome == 'success'
|
2023-01-30 08:59:45 +00:00
|
|
|
timeout-minutes: 2.5
|
2022-10-28 13:59:09 +00:00
|
|
|
run: |
|
2022-12-19 13:07:23 +00: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 14:16:06 +00:00
|
|
|
- name: 'Check GDB output'
|
|
|
|
if: failure()
|
2022-12-19 13:07:23 +00: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 14:16:06 +00:00
|
|
|
./fbt gdb_trace_all OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|