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