unit_tests.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: 'Unit tests'
  2. on:
  3. pull_request:
  4. env:
  5. TARGETS: f7
  6. DEFAULT_TARGET: f7
  7. jobs:
  8. main:
  9. runs-on: [self-hosted, FlipperZeroTest]
  10. steps:
  11. - name: Checkout code
  12. uses: actions/checkout@v2
  13. with:
  14. fetch-depth: 0
  15. ref: ${{ github.event.pull_request.head.sha }}
  16. - name: 'Get flipper from device manager (mock)'
  17. id: device
  18. run: |
  19. echo "flipper=/dev/ttyACM0" >> $GITHUB_OUTPUT
  20. - name: 'Compile unit tests firmware'
  21. id: compile
  22. run: |
  23. FBT_TOOLCHAIN_PATH=/opt ./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
  24. - name: 'Wait for flipper to finish updating'
  25. id: connect
  26. if: steps.compile.outcome == 'success'
  27. run: |
  28. python3 ./scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
  29. - name: 'Format flipper SD card'
  30. id: format
  31. if: steps.connect.outcome == 'success'
  32. run: |
  33. ./scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
  34. - name: 'Copy assets and unit tests data to flipper'
  35. id: copy
  36. if: steps.format.outcome == 'success'
  37. run: |
  38. ./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/resources /ext
  39. ./scripts/storage.py -p ${{steps.device.outputs.flipper}} send assets/unit_tests /ext/unit_tests
  40. - name: 'Run units and validate results'
  41. if: steps.copy.outcome == 'success'
  42. run: |
  43. python3 ./scripts/testing/units.py ${{steps.device.outputs.flipper}}