5a8c1123af0fba8af4c9ab54b4dadbe554acf488
[openwrt/staging/stintel.git] / .github / workflows / kernel.yml
1 name: Build Kernel
2
3 on:
4 pull_request:
5 paths:
6 - '.github/workflows/check-kernel-patches.yml'
7 - '.github/workflows/build.yml'
8 - '.github/workflows/kernel.yml'
9 - 'include/kernel*'
10 - 'package/kernel/**'
11 - 'target/linux/generic/**'
12 push:
13 paths:
14 - '.github/workflows/check-kernel-patches.yml'
15 - '.github/workflows/build.yml'
16 - '.github/workflows/kernel.yml'
17 - 'include/kernel*'
18 - 'package/kernel/**'
19 - 'target/linux/generic/**'
20
21 permissions:
22 contents: read
23
24 jobs:
25 determine_targets:
26 name: Set targets
27 runs-on: ubuntu-latest
28 outputs:
29 target: ${{ steps.find_targets.outputs.target }}
30
31 steps:
32 - name: Checkout
33 uses: actions/checkout@v3
34
35 - name: Set targets
36 id: find_targets
37 run: |
38 export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \
39 | sort -u -t '/' -k1,1 \
40 | awk '{ print $1 }')"
41
42 JSON='['
43 FIRST=1
44 for TARGET in $TARGETS; do
45 [[ $FIRST -ne 1 ]] && JSON="$JSON"','
46 JSON="$JSON"'"'"${TARGET}"'"'
47 FIRST=0
48 done
49 JSON="$JSON"']'
50
51 echo -e "\n---- targets ----\n"
52 echo "$JSON"
53 echo -e "\n---- targets ----\n"
54
55 echo "target=$JSON" >> $GITHUB_OUTPUT
56
57 build:
58 name: Build Kernel with external toolchain
59 needs: determine_targets
60 permissions:
61 contents: read
62 packages: read
63 strategy:
64 fail-fast: False
65 matrix:
66 target: ${{fromJson(needs.determine_targets.outputs.target)}}
67 uses: ./.github/workflows/build.yml
68 with:
69 target: ${{ matrix.target }}
70 build_all_kmods: true
71 include_feeds: true
72
73 check-kernel-patches:
74 name: Check Kernel patches
75 needs: determine_targets
76 permissions:
77 contents: read
78 packages: read
79 strategy:
80 fail-fast: False
81 matrix:
82 target: ${{fromJson(needs.determine_targets.outputs.target)}}
83 uses: ./.github/workflows/check-kernel-patches.yml
84 with:
85 target: ${{ matrix.target }}
86