CI: Build all boards and testing kernel
[openwrt/staging/stintel.git] / .github / workflows / check-kernel-patches.yml
1 name: Refresh kernel for target
2
3 on:
4 workflow_call:
5 inputs:
6 target:
7 required: true
8 type: string
9 testing:
10 type: boolean
11
12 permissions:
13 contents: read
14
15 jobs:
16 setup_build:
17 name: Setup build
18 runs-on: ubuntu-latest
19 outputs:
20 owner_lc: ${{ steps.lower_owner.outputs.owner_lc }}
21
22 steps:
23 - name: Set lower case owner name
24 id: lower_owner
25 run: |
26 OWNER_LC=$(echo "${{ github.repository_owner }}" \
27 | tr '[:upper:]' '[:lower:]')
28 echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
29
30 check-patch:
31 name: Check Kernel patches
32 needs: setup_build
33 runs-on: ubuntu-latest
34
35 container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:latest
36
37 permissions:
38 contents: read
39 packages: read
40
41 steps:
42 - name: Checkout master directory
43 uses: actions/checkout@v3
44 with:
45 path: openwrt
46
47 - name: Fix permission
48 run: |
49 chown -R buildbot:buildbot openwrt
50
51 - name: Initialization environment
52 run: |
53 TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1)
54 SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2)
55 echo "TARGET=$TARGET" >> "$GITHUB_ENV"
56 echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV"
57
58 - name: Extract prebuilt tools
59 shell: su buildbot -c "sh -e {0}"
60 working-directory: openwrt
61 run: ./scripts/ext-tools.sh --tools /tools.tar
62
63 - name: Configure testing kernel
64 if: inputs.testing == true
65 shell: su buildbot -c "sh -e {0}"
66 working-directory: openwrt
67 run: |
68 echo CONFIG_TESTING_KERNEL=y >> .config
69
70 - name: Configure system
71 shell: su buildbot -c "sh -e {0}"
72 working-directory: openwrt
73 run: |
74 echo CONFIG_ALL_KMODS=y >> .config
75 echo CONFIG_DEVEL=y >> .config
76 echo CONFIG_AUTOREMOVE=y >> .config
77 echo CONFIG_CCACHE=y >> .config
78
79 echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config
80 echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config
81
82 make defconfig
83
84 - name: Build tools
85 shell: su buildbot -c "sh -e {0}"
86 working-directory: openwrt
87 run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
88
89 - name: Refresh Kernel patches
90 shell: su buildbot -c "sh -e {0}"
91 working-directory: openwrt
92 run: |
93 make target/linux/refresh V=s
94
95 . .github/workflows/scripts/ci_helpers.sh
96
97 if git diff --name-only --exit-code; then
98 success "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok"
99 else
100 err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)"
101 exit 1
102 fi