build-tools.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: Build host tools
  2. on:
  3. workflow_call:
  4. inputs:
  5. generate_prebuilt_artifacts:
  6. type: boolean
  7. permissions:
  8. contents: read
  9. jobs:
  10. build:
  11. name: Build tools
  12. runs-on: ubuntu-latest
  13. container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@v3
  17. with:
  18. path: openwrt
  19. - name: Fix permission
  20. run: chown -R buildbot:buildbot openwrt
  21. - name: Set configs for tools container
  22. shell: su buildbot -c "sh -e {0}"
  23. working-directory: openwrt
  24. run: |
  25. touch .config
  26. echo CONFIG_DEVEL=y >> .config
  27. echo CONFIG_AUTOREMOVE=y >> .config
  28. echo CONFIG_CCACHE=y >> .config
  29. - name: Make prereq
  30. shell: su buildbot -c "sh -e {0}"
  31. working-directory: openwrt
  32. run: make defconfig
  33. - name: Build tools
  34. shell: su buildbot -c "sh -e {0}"
  35. working-directory: openwrt
  36. run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
  37. - name: Upload logs
  38. if: always()
  39. uses: actions/upload-artifact@v3
  40. with:
  41. name: linux-buildbot-logs
  42. path: openwrt/logs
  43. - name: Upload config
  44. if: always()
  45. uses: actions/upload-artifact@v3
  46. with:
  47. name: linux-buildbot-config
  48. path: openwrt/.config
  49. - name: Archive prebuilt tools
  50. if: inputs.generate_prebuilt_artifacts == true
  51. shell: su buildbot -c "sh -e {0}"
  52. working-directory: openwrt
  53. run: tar -cf tools.tar staging_dir/host build_dir/host
  54. - name: Upload prebuilt tools
  55. if: inputs.generate_prebuilt_artifacts == true
  56. uses: actions/upload-artifact@v3
  57. with:
  58. name: linux-buildbot-prebuilt-tools
  59. path: openwrt/tools.tar
  60. retention-days: 1