ca415489c5a58f906359cdfd92fa6581ccba5416
[openwrt/openwrt.git] / .github / workflows / build-tools.yml
1 name: Build host tools
2
3 on:
4 workflow_call:
5 inputs:
6 generate_prebuilt_artifacts:
7 type: boolean
8
9 permissions:
10 contents: read
11
12 jobs:
13 build:
14 name: Build tools
15 runs-on: ubuntu-latest
16 container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1
17
18 steps:
19 - name: Checkout
20 uses: actions/checkout@v3
21 with:
22 path: openwrt
23
24 - name: Fix permission
25 run: chown -R buildbot:buildbot openwrt
26
27 - name: Set configs for tools container
28 shell: su buildbot -c "sh -e {0}"
29 working-directory: openwrt
30 run: |
31 touch .config
32 echo CONFIG_DEVEL=y >> .config
33 echo CONFIG_AUTOREMOVE=y >> .config
34 echo CONFIG_CCACHE=y >> .config
35
36 - name: Make prereq
37 shell: su buildbot -c "sh -e {0}"
38 working-directory: openwrt
39 run: make defconfig
40
41 - name: Build tools
42 shell: su buildbot -c "sh -e {0}"
43 working-directory: openwrt
44 run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
45
46 - name: Upload logs
47 if: always()
48 uses: actions/upload-artifact@v3
49 with:
50 name: linux-buildbot-logs
51 path: openwrt/logs
52
53 - name: Upload config
54 if: always()
55 uses: actions/upload-artifact@v3
56 with:
57 name: linux-buildbot-config
58 path: openwrt/.config
59
60 - name: Archive prebuilt tools
61 if: inputs.generate_prebuilt_artifacts == true
62 shell: su buildbot -c "sh -e {0}"
63 working-directory: openwrt
64 run: tar --mtime=now -cf tools.tar staging_dir/host build_dir/host dl
65
66 - name: Upload prebuilt tools
67 if: inputs.generate_prebuilt_artifacts == true
68 uses: actions/upload-artifact@v3
69 with:
70 name: linux-buildbot-prebuilt-tools
71 path: openwrt/tools.tar
72 retention-days: 1