CI: use toolchain container for label workflow
[openwrt/staging/jow.git] / .github / workflows / label-kernel.yml
1 # ci:kernel:x86:64 is going to trigger CI kernel check jobs for x86/64 target
2
3 name: Build kernel and check patches for target specified in labels
4 on:
5 pull_request:
6 types:
7 - labeled
8
9 jobs:
10 set_target:
11 if: startsWith(github.event.label.name, 'ci:kernel:')
12 name: Set target
13 runs-on: ubuntu-latest
14 outputs:
15 target: ${{ steps.set_target.outputs.target }}
16 subtarget: ${{ steps.set_target.outputs.subtarget }}
17
18 steps:
19 - name: Set target
20 id: set_target
21 env:
22 CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
23 run: |
24 echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT
25 echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT
26
27 build_kernel:
28 name: Build Kernel with external toolchain
29 needs: set_target
30 permissions:
31 contents: read
32 packages: read
33 uses: ./.github/workflows/build.yml
34 with:
35 container_name: toolchain
36 target: ${{ needs.set_target.outputs.target }}
37 subtarget: ${{ needs.set_target.outputs.subtarget }}
38 build_kernel: true
39 build_all_kmods: true
40
41 check-kernel-patches:
42 name: Check Kernel patches
43 needs: set_target
44 permissions:
45 contents: read
46 packages: read
47 uses: ./.github/workflows/check-kernel-patches.yml
48 with:
49 target: ${{ needs.set_target.outputs.target }}
50 subtarget: ${{ needs.set_target.outputs.subtarget }}