19c11f03a6237cfd6cf27e901ae13e2c85cbae35
[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 libidn2 \
58 libunistring \
59 m4 \
60 make \
61 mpfr \
62 ncurses \
63 openssl@1.1 \
64 pcre \
65 pkg-config \
66 quilt \
67 readline \
68 wget \
69 zstd
70
71 echo "/bin" >> "$GITHUB_PATH"
72 echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH"
73 echo "/usr/bin" >> "$GITHUB_PATH"
74 echo "/usr/local/bin" >> "$GITHUB_PATH"
75 echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH"
76 echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
77 echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH"
78 echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH"
79 echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
80 echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
81 echo "/usr/sbin" >> "$GITHUB_PATH"
82
83 - name: Make prereq
84 working-directory: ${{ env.WORKPATH }}/openwrt
85 run: make defconfig
86
87 - name: Build tools MacOS
88 working-directory: ${{ env.WORKPATH }}/openwrt
89 run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
90
91 - name: Upload logs
92 if: always()
93 uses: actions/upload-artifact@v3
94 with:
95 name: macos-latest-logs
96 path: ${{ env.WORKPATH }}/openwrt/logs
97
98 - name: Upload config
99 if: always()
100 uses: actions/upload-artifact@v3
101 with:
102 name: macos-latest-config
103 path: ${{ env.WORKPATH }}/openwrt/.config
104
105 build-linux-buildbot:
106 name: Build tools with buildbot container
107 uses: ./.github/workflows/build-tools.yml