updater_test.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: 'Updater test'
  2. on:
  3. pull_request:
  4. env:
  5. TARGETS: f7
  6. DEFAULT_TARGET: f7
  7. FBT_TOOLCHAIN_PATH: /opt
  8. jobs:
  9. test_updater_on_bench:
  10. runs-on: [self-hosted, FlipperZeroUpdaterTest]
  11. steps:
  12. - name: 'Wipe workspace'
  13. run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
  14. - name: Checkout code
  15. uses: actions/checkout@v3
  16. with:
  17. fetch-depth: 1
  18. submodules: false
  19. ref: ${{ github.event.pull_request.head.sha }}
  20. - name: 'Get flipper from device manager (mock)'
  21. id: device
  22. run: |
  23. echo "flipper=Rekigyn" >> $GITHUB_OUTPUT
  24. echo "stlink=0F020D026415303030303032" >> $GITHUB_OUTPUT
  25. - name: 'Flashing target firmware'
  26. id: first_full_flash
  27. run: |
  28. source scripts/toolchain/fbtenv.sh
  29. ./fbt flash_usb_full PORT=${{steps.device.outputs.flipper}} FORCE=1
  30. python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
  31. - name: 'Validating updater'
  32. id: second_full_flash
  33. if: success()
  34. run: |
  35. source scripts/toolchain/fbtenv.sh
  36. ./fbt flash_usb PORT=${{steps.device.outputs.flipper}} FORCE=1
  37. python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
  38. - name: 'Get last release tag'
  39. id: release_tag
  40. if: failure()
  41. run: |
  42. echo "tag=$(git tag -l --sort=-version:refname | grep -v "rc\|RC" | head -1)" >> $GITHUB_OUTPUT
  43. - name: 'Wipe workspace'
  44. run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
  45. - name: 'Checkout latest release'
  46. uses: actions/checkout@v3
  47. if: failure()
  48. with:
  49. fetch-depth: 1
  50. ref: ${{ steps.release_tag.outputs.tag }}
  51. - name: 'Flash last release'
  52. if: failure()
  53. run: |
  54. ./fbt flash OPENOCD_ADAPTER_SERIAL=${{steps.device.outputs.stlink}} FORCE=1
  55. - name: 'Wait for flipper and format ext'
  56. if: failure()
  57. run: |
  58. source scripts/toolchain/fbtenv.sh
  59. python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
  60. python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext