tools.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: Build host tools
  2. on:
  3. pull_request:
  4. paths:
  5. - 'tools/**'
  6. - '.github/workflows/build-tools.yml'
  7. - '.github/workflows/tools.yml'
  8. push:
  9. paths:
  10. - 'tools/**'
  11. - '.github/workflows/build-tools.yml'
  12. - '.github/workflows/tools.yml'
  13. permissions:
  14. contents: read
  15. concurrency:
  16. group: ${{ github.workflow }}-${{ github.ref }}
  17. cancel-in-progress: ${{ github.event_name == 'pull_request' }}
  18. jobs:
  19. build-macos-latest:
  20. name: Build tools with macos latest
  21. runs-on: macos-latest
  22. steps:
  23. - name: Checkout
  24. uses: actions/checkout@v3
  25. with:
  26. path: openwrt
  27. - name: Setup MacOS
  28. run: |
  29. echo "WORKPATH=/Volumes/OpenWrt" >> "$GITHUB_ENV"
  30. hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage
  31. hdiutil attach OpenWrt.sparseimage
  32. mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/
  33. - name: Install required prereq on MacOS
  34. working-directory: ${{ env.WORKPATH }}/openwrt
  35. run: |
  36. brew install \
  37. automake \
  38. coreutils \
  39. diffutils \
  40. findutils \
  41. gawk \
  42. git-extras \
  43. gnu-getopt \
  44. gnu-sed \
  45. grep \
  46. make
  47. echo "/bin" >> "$GITHUB_PATH"
  48. echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH"
  49. echo "/usr/bin" >> "$GITHUB_PATH"
  50. echo "/usr/local/bin" >> "$GITHUB_PATH"
  51. echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH"
  52. echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
  53. echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH"
  54. echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH"
  55. echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
  56. echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
  57. echo "/usr/sbin" >> "$GITHUB_PATH"
  58. - name: Make prereq
  59. working-directory: ${{ env.WORKPATH }}/openwrt
  60. run: make defconfig
  61. - name: Build tools MacOS
  62. working-directory: ${{ env.WORKPATH }}/openwrt
  63. run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
  64. - name: Upload logs
  65. if: always()
  66. uses: actions/upload-artifact@v3
  67. with:
  68. name: macos-latest-logs
  69. path: ${{ env.WORKPATH }}/openwrt/logs
  70. - name: Upload config
  71. if: always()
  72. uses: actions/upload-artifact@v3
  73. with:
  74. name: macos-latest-config
  75. path: ${{ env.WORKPATH }}/openwrt/.config
  76. build-linux-buildbot:
  77. name: Build tools with buildbot container
  78. uses: ./.github/workflows/build-tools.yml