tools.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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-sed \
  44. grep \
  45. make
  46. echo "/bin" >> "$GITHUB_PATH"
  47. echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH"
  48. echo "/usr/bin" >> "$GITHUB_PATH"
  49. echo "/usr/local/bin" >> "$GITHUB_PATH"
  50. echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH"
  51. echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
  52. echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH"
  53. echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH"
  54. echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
  55. echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
  56. echo "/usr/sbin" >> "$GITHUB_PATH"
  57. - name: Make prereq
  58. working-directory: ${{ env.WORKPATH }}/openwrt
  59. run: make defconfig
  60. - name: Build tools MacOS
  61. working-directory: ${{ env.WORKPATH }}/openwrt
  62. run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
  63. - name: Upload logs
  64. if: always()
  65. uses: actions/upload-artifact@v3
  66. with:
  67. name: macos-latest-logs
  68. path: ${{ env.WORKPATH }}/openwrt/logs
  69. - name: Upload config
  70. if: always()
  71. uses: actions/upload-artifact@v3
  72. with:
  73. name: macos-latest-config
  74. path: ${{ env.WORKPATH }}/openwrt/.config
  75. build-linux-buildbot:
  76. name: Build tools with buildbot container
  77. uses: ./.github/workflows/build-tools.yml