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