tools.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. jobs:
  16. build-macos-latest:
  17. name: Build tools with macos latest
  18. runs-on: macos-latest
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v3
  22. with:
  23. path: openwrt
  24. - name: Setup MacOS
  25. run: |
  26. echo "WORKPATH=/Volumes/OpenWrt" >> "$GITHUB_ENV"
  27. hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage
  28. hdiutil attach OpenWrt.sparseimage
  29. mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/
  30. - name: Install required prereq on MacOS
  31. working-directory: ${{ env.WORKPATH }}/openwrt
  32. run: |
  33. brew install \
  34. autoconf \
  35. automake \
  36. coreutils \
  37. diffutils \
  38. findutils \
  39. gawk \
  40. gettext \
  41. git-extras \
  42. gmp \
  43. gnu-getopt \
  44. gnu-sed \
  45. gnu-tar \
  46. grep \
  47. libidn2 \
  48. libunistring \
  49. m4 \
  50. make \
  51. mpfr \
  52. ncurses \
  53. [email protected] \
  54. pcre \
  55. pkg-config \
  56. quilt \
  57. readline \
  58. wget \
  59. zstd
  60. echo "/bin" >> "$GITHUB_PATH"
  61. echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH"
  62. echo "/usr/bin" >> "$GITHUB_PATH"
  63. echo "/usr/local/bin" >> "$GITHUB_PATH"
  64. echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH"
  65. echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
  66. echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH"
  67. echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH"
  68. echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
  69. echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
  70. echo "/usr/sbin" >> "$GITHUB_PATH"
  71. - name: Make prereq
  72. working-directory: ${{ env.WORKPATH }}/openwrt
  73. run: make defconfig
  74. - name: Build tools MacOS
  75. working-directory: ${{ env.WORKPATH }}/openwrt
  76. run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
  77. - name: Upload logs
  78. if: always()
  79. uses: actions/upload-artifact@v3
  80. with:
  81. name: macos-latest-logs
  82. path: ${{ env.WORKPATH }}/openwrt/logs
  83. - name: Upload config
  84. if: always()
  85. uses: actions/upload-artifact@v3
  86. with:
  87. name: macos-latest-config
  88. path: ${{ env.WORKPATH }}/openwrt/.config
  89. build-linux-buildbot:
  90. name: Build tools with buildbot container
  91. uses: ./.github/workflows/build-tools.yml