6 - '.github/workflows/check-kernel-patches.yml'
7 - '.github/workflows/build.yml'
8 - '.github/workflows/kernel.yml'
14 - '.github/workflows/check-kernel-patches.yml'
15 - '.github/workflows/build.yml'
16 - '.github/workflows/kernel.yml'
27 group: ${{ github.workflow }}-${{ github.ref }}
28 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
33 runs-on: ubuntu-latest
35 targets_subtargets: ${{ steps.find_targets.outputs.targets_subtargets }}
36 targets: ${{ steps.find_targets.outputs.targets }}
40 uses: actions/checkout@v3
44 - name: Get changed files
46 uses: tj-actions/changed-files@v35
51 ALL_TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null)"
52 CHANGED_FILES="$(echo ${{ steps.changed-files.outputs.all_changed_files }} | tr ' ' '\n')"
54 TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1 | awk '{ print $1 }')"
55 TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1 | awk '{ print $1 }')"
57 # On testing non-specific target, skip testing each subtarget
58 if echo "$CHANGED_FILES" | grep -v -q target/linux ||
59 echo "$CHANGED_FILES" | grep -q target/linux/generic; then
60 TARGETS_SUBTARGETS=$TARGETS
63 JSON_TARGETS_SUBTARGETS='['
65 for TARGET in $TARGETS_SUBTARGETS; do
66 if echo "$CHANGED_FILES" | grep -v -q target/linux ||
67 echo "$CHANGED_FILES" | grep -q target/linux/generic ||
68 echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then
69 TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
70 [[ $FIRST -ne 1 ]] && JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"','
71 JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE"
75 JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"']'
79 for TARGET in $TARGETS; do
80 if echo "$CHANGED_FILES" | grep -v -q target/linux ||
81 echo "$CHANGED_FILES" | grep -q target/linux/generic ||
82 echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then
83 TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
84 [[ $FIRST -ne 1 ]] && JSON_TARGETS="$JSON_TARGETS"','
85 JSON_TARGETS="$JSON_TARGETS""$TUPLE"
89 JSON_TARGETS="$JSON_TARGETS"']'
91 echo -e "\n---- targets to build ----\n"
92 echo "$JSON_TARGETS_SUBTARGETS"
93 echo -e "\n---- targets to build ----\n"
95 echo -e "\n---- targets to check patch ----\n"
97 echo -e "\n---- targets to check patch ----\n"
99 echo "targets_subtargets=$JSON_TARGETS_SUBTARGETS" >> $GITHUB_OUTPUT
100 echo "targets=$JSON_TARGETS" >> $GITHUB_OUTPUT
103 name: Build Kernel with external toolchain
104 needs: determine_targets
111 include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
112 uses: ./.github/workflows/build.yml
114 container_name: toolchain
115 target: ${{ matrix.target }}
116 subtarget: ${{ matrix.subtarget }}
118 build_all_kmods: true
120 check-kernel-patches:
121 name: Check Kernel patches
122 needs: determine_targets
129 include: ${{fromJson(needs.determine_targets.outputs.targets)}}
130 uses: ./.github/workflows/check-kernel-patches.yml
132 target: ${{ matrix.target }}
133 subtarget: ${{ matrix.subtarget }}