updater_test.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: 'Decontaminate previous build leftovers'
  13. run: |
  14. if [ -d .git ]; then
  15. git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
  16. fi
  17. - name: Checkout code
  18. uses: actions/checkout@v3
  19. with:
  20. fetch-depth: 1
  21. submodules: false
  22. ref: ${{ github.event.pull_request.head.sha }}
  23. - name: 'Get flipper from device manager (mock)'
  24. id: device
  25. run: |
  26. echo "flipper=Rekigyn" >> $GITHUB_OUTPUT
  27. echo "stlink=0F020D026415303030303032" >> $GITHUB_OUTPUT
  28. - name: 'Flashing target firmware'
  29. id: first_full_flash
  30. run: |
  31. source scripts/toolchain/fbtenv.sh
  32. ./fbt flash_usb_full PORT=${{steps.device.outputs.flipper}} FORCE=1
  33. python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
  34. - name: 'Validating updater'
  35. id: second_full_flash
  36. if: success()
  37. run: |
  38. source scripts/toolchain/fbtenv.sh
  39. ./fbt flash_usb PORT=${{steps.device.outputs.flipper}} FORCE=1
  40. python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
  41. - name: 'Get last release tag'
  42. id: release_tag
  43. if: failure()
  44. run: |
  45. echo "tag=$(git tag -l --sort=-version:refname | grep -v "rc\|RC" | head -1)" >> $GITHUB_OUTPUT
  46. - name: 'Decontaminate previous build leftovers'
  47. if: failure()
  48. run: |
  49. if [ -d .git ]; then
  50. git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
  51. fi
  52. - name: 'Checkout latest release'
  53. uses: actions/checkout@v3
  54. if: failure()
  55. with:
  56. fetch-depth: 1
  57. ref: ${{ steps.release_tag.outputs.tag }}
  58. - name: 'Flash last release'
  59. if: failure()
  60. run: |
  61. ./fbt flash OPENOCD_ADAPTER_SERIAL=${{steps.device.outputs.stlink}} FORCE=1
  62. - name: 'Wait for flipper and format ext'
  63. if: failure()
  64. run: |
  65. source scripts/toolchain/fbtenv.sh
  66. python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
  67. python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext