Dockerized action runners and script updates #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Testing workflows' | |
on: | |
pull_request: | |
env: | |
TARGETS: f7 | |
DEFAULT_TARGET: f7 | |
FBT_TOOLCHAIN_PATH: /opt | |
ACTIONS_RUNNER_DEBUG: true | |
jobs: | |
unit_tests_dockerized: | |
runs-on: [self-hosted, FlipperZeroIntegrationTest] | |
steps: | |
- name: 'Wipe workspace' | |
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \; | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: 'Flash unit tests firmware' | |
id: flashing | |
if: success() | |
timeout-minutes: 10 | |
run: | | |
source scripts/toolchain/fbtenv.sh | |
./fbt resources firmware_latest flash LIB_DEBUG=1 FIRMWARE_APP_SET=unit_tests FORCE=1 | |
python3 scripts/testops.py await_flipper | |
- name: 'Copy assets and unit data, reboot and wait for flipper' | |
id: copy | |
timeout-minutes: 7 | |
run: | | |
source scripts/toolchain/fbtenv.sh | |
rm -rf build/latest/resources/dolphin | |
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send build/latest/resources /ext | |
- name: 'Run units and validate results' | |
id: run_units | |
timeout-minutes: 7 | |
run: | | |
source scripts/toolchain/fbtenv.sh | |
python3 scripts/testops.py run_units | |
- name: 'Check GDB output' | |
if: failure() | |
run: | | |
./fbt gdb_trace_all FIRMWARE_APP_SET=unit_tests LIB_DEBUG=1 FORCE=1 | |
- name: 'Create notification' | |
if: failure() | |
run: | | |
echo "::error ::Unit tests failed, check that step for details" | |
updater_tests_dockerized: | |
runs-on: [self-hosted, FlipperZeroIntegrationTest] | |
steps: | |
- name: 'Wipe workspace' | |
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \; | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
submodules: false | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: 'Flashing target firmware' | |
id: first_full_flash | |
timeout-minutes: 10 | |
run: | | |
source scripts/toolchain/fbtenv.sh | |
./fbt flash_usb_full FORCE=1 | |
python3 scripts/testops.py await_flipper | |
- name: 'Validating updater' | |
id: second_full_flash | |
timeout-minutes: 5 | |
run: | | |
source scripts/toolchain/fbtenv.sh | |
./fbt flash_usb_full FORCE=1 | |
python3 scripts/testops.py await_flipper | |
- name: 'Create notification' | |
if: failure() | |
run: | | |
echo "::error ::Flipper updater failure" | |