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