mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-30 08:20:21 +00:00
9d728a1c65
* Add base * Add base again * Test reporting * Fix reporting * Fix secrets * Fix arguments in report * Remove depricated actions * Disable reporting on PR Co-authored-by: あく <alleteam@gmail.com>
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: 'Unit tests'
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
env:
|
|
TARGETS: f7
|
|
DEFAULT_TARGET: f7
|
|
|
|
jobs:
|
|
run_units_on_test_bench:
|
|
runs-on: [self-hosted, FlipperZeroTest]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: 'Get flipper from device manager (mock)'
|
|
id: device
|
|
run: |
|
|
echo "flipper=/dev/ttyACM0" >> $GITHUB_OUTPUT
|
|
|
|
- name: 'Flash unit tests firmware'
|
|
id: flashing
|
|
run: |
|
|
FBT_TOOLCHAIN_PATH=/opt ./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|
|
|
|
- name: 'Wait for flipper to finish updating'
|
|
id: connect
|
|
if: steps.flashing.outcome == 'success'
|
|
run: |
|
|
. scripts/toolchain/fbtenv.sh
|
|
./scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
|
|
|
|
- name: 'Format flipper SD card'
|
|
id: format
|
|
if: steps.connect.outcome == 'success'
|
|
run: |
|
|
. scripts/toolchain/fbtenv.sh
|
|
./scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
|
|
|
|
- name: 'Copy assets and unit tests data to flipper'
|
|
id: copy
|
|
if: steps.format.outcome == 'success'
|
|
run: |
|
|
. scripts/toolchain/fbtenv.sh
|
|
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/resources /ext
|
|
./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/unit_tests /ext/unit_tests
|
|
|
|
- name: 'Run units and validate results'
|
|
if: steps.copy.outcome == 'success'
|
|
run: |
|
|
. scripts/toolchain/fbtenv.sh
|
|
./scripts/testing/units.py ${{steps.device.outputs.flipper}}
|