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