ci.yml 3.2 KB

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