ci.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. name: 'CI'
  2. on:
  3. push:
  4. paths-ignore:
  5. - 'wiki/**'
  6. - 'wiki_static/**'
  7. pull_request:
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout code
  13. uses: actions/checkout@v2
  14. with:
  15. submodules: true
  16. lfs: true
  17. - uses: satackey/action-docker-layer-caching@v0.0.8
  18. continue-on-error: true
  19. with:
  20. key: docker-cache-${{ hashFiles('docker/**') }}-{hash}
  21. restore-keys: docker-cache-${{ hashFiles('docker/**') }}-
  22. - name: Build docker image
  23. uses: ./.github/actions/docker
  24. - name: Check syntax
  25. uses: ./.github/actions/docker
  26. continue-on-error: false
  27. with:
  28. run: /syntax_check.sh
  29. - name: Build F2 bootloader in docker
  30. uses: ./.github/actions/docker
  31. with:
  32. run: make -C bootloader TARGET=f2
  33. - name: Publish F2 bootloader artifacts
  34. uses: actions/upload-artifact@v2
  35. with:
  36. name: bootloader_f2
  37. path: |
  38. bootloader/.obj/f2/bootloader.elf
  39. bootloader/.obj/f2/bootloader.bin
  40. bootloader/.obj/f2/bootloader.hex
  41. if-no-files-found: error
  42. retention-days: 7
  43. - name: Build local testing firmware in docker
  44. uses: ./.github/actions/docker
  45. with:
  46. run: make -C firmware TARGET=local
  47. - name: Run local tests
  48. uses: ./.github/actions/docker
  49. with:
  50. run: make -C firmware TARGET=local APP_TEST=1 run
  51. - name: Build F2 firmware in docker
  52. uses: ./.github/actions/docker
  53. with:
  54. run: make -C firmware TARGET=f2 APP_RELEASE=1
  55. - name: Publish F2 firmware artifacts
  56. uses: actions/upload-artifact@v2
  57. with:
  58. name: firmware_f2
  59. path: |
  60. firmware/.obj/f2/firmware.elf
  61. firmware/.obj/f2/firmware.bin
  62. firmware/.obj/f2/firmware.hex
  63. if-no-files-found: error
  64. retention-days: 7
  65. upload:
  66. name: Upload artifacts to external storage
  67. needs: build
  68. runs-on: ubuntu-latest
  69. steps:
  70. - name: Get bootloader
  71. uses: actions/download-artifact@v2
  72. with:
  73. name: bootloader_f2
  74. path: bootloader
  75. - name: Get firmware
  76. uses: actions/download-artifact@v2
  77. with:
  78. name: firmware_f2
  79. path: firmware
  80. - name: ls for downloaded file
  81. run: ls -R
  82. - name: Upload bootloader
  83. uses: burnett01/rsync-deployments@4.1
  84. with:
  85. switches: -avzp --delete
  86. path: bootloader
  87. remote_path: "${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${GITHUB_REF##*/}/"
  88. remote_host: ${{ secrets.RSYNC_DEPLOY_HOST }}
  89. remote_user: ${{ secrets.RSYNC_DEPLOY_USER }}
  90. remote_key: ${{ secrets.RSYNC_DEPLOY_KEY }}
  91. - name: Upload firmware
  92. uses: burnett01/rsync-deployments@4.1
  93. with:
  94. switches: -avzp --delete
  95. path: firmware
  96. remote_path: "${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${GITHUB_REF##*/}/"
  97. remote_host: ${{ secrets.RSYNC_DEPLOY_HOST }}
  98. remote_user: ${{ secrets.RSYNC_DEPLOY_USER }}
  99. remote_key: ${{ secrets.RSYNC_DEPLOY_KEY }}