build-tools.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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: ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v6
  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. echo CONFIG_BUILD_ALL_HOST_TOOLS=y >> .config
  30. - name: Make prereq
  31. shell: su buildbot -c "sh -e {0}"
  32. working-directory: openwrt
  33. run: make defconfig
  34. - name: Build tools
  35. shell: su buildbot -c "sh -e {0}"
  36. working-directory: openwrt
  37. run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
  38. - name: Upload logs
  39. if: always()
  40. uses: actions/upload-artifact@v3
  41. with:
  42. name: linux-buildbot-logs
  43. path: openwrt/logs
  44. - name: Upload config
  45. if: always()
  46. uses: actions/upload-artifact@v3
  47. with:
  48. name: linux-buildbot-config
  49. path: openwrt/.config
  50. - name: Archive prebuilt tools
  51. if: inputs.generate_prebuilt_artifacts == true
  52. shell: su buildbot -c "sh -e {0}"
  53. working-directory: openwrt
  54. run: tar -cf tools.tar staging_dir/host build_dir/host
  55. - name: Upload prebuilt tools
  56. if: inputs.generate_prebuilt_artifacts == true
  57. uses: actions/upload-artifact@v3
  58. with:
  59. name: linux-buildbot-prebuilt-tools
  60. path: openwrt/tools.tar
  61. retention-days: 1