tools.yml 2.8 KB

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