CI: build: add job to remove previous ccache cache if already exist
[openwrt/staging/hauke.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 actions: write
34 uses: ./.github/workflows/build.yml
35 with:
36 container_name: toolchain
37 target: ${{ needs.set_target.outputs.target }}
38 subtarget: ${{ needs.set_target.outputs.subtarget }}
39 build_kernel: true
40 build_all_kmods: true
41
42 check-kernel-patches:
43 name: Check Kernel patches
44 needs: set_target
45 permissions:
46 contents: read
47 packages: read
48 actions: write
49 uses: ./.github/workflows/check-kernel-patches.yml
50 with:
51 target: ${{ needs.set_target.outputs.target }}
52 subtarget: ${{ needs.set_target.outputs.subtarget }}