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'
25 group: ${{ github.workflow }}-${{ github.ref }}
26 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
31 runs-on: ubuntu-latest
33 targets_subtargets: ${{ steps.find_targets.outputs.targets_subtargets }}
34 targets: ${{ steps.find_targets.outputs.targets }}
38 uses: actions/checkout@v3
42 - name: Get changed files
44 uses: tj-actions/changed-files@v35
49 ALL_TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null)"
50 CHANGED_FILES="$(echo ${{ steps.changed-files.outputs.all_changed_files }} | tr ' ' '\n')"
52 TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1 | awk '{ print $1 }')"
53 TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1 | awk '{ print $1 }')"
55 # On testing non-specific target, skip testing each subtarget
56 if echo "$CHANGED_FILES" | grep -v -q target/linux ||
57 echo "$CHANGED_FILES" | grep -q target/linux/generic; then
58 TARGETS_SUBTARGETS=$TARGETS
61 JSON_TARGETS_SUBTARGETS='['
63 for TARGET in $TARGETS_SUBTARGETS; do
64 if echo "$CHANGED_FILES" | grep -v -q target/linux ||
65 echo "$CHANGED_FILES" | grep -q target/linux/generic ||
66 echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then
67 TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
68 [[ $FIRST -ne 1 ]] && JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"','
69 JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE"
73 JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"']'
77 for TARGET in $TARGETS; do
78 if echo "$CHANGED_FILES" | grep -v -q target/linux ||
79 echo "$CHANGED_FILES" | grep -q target/linux/generic ||
80 echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then
81 TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
82 [[ $FIRST -ne 1 ]] && JSON_TARGETS="$JSON_TARGETS"','
83 JSON_TARGETS="$JSON_TARGETS""$TUPLE"
87 JSON_TARGETS="$JSON_TARGETS"']'
89 echo -e "\n---- targets to build ----\n"
90 echo "$JSON_TARGETS_SUBTARGETS"
91 echo -e "\n---- targets to build ----\n"
93 echo -e "\n---- targets to check patch ----\n"
95 echo -e "\n---- targets to check patch ----\n"
97 echo "targets_subtargets=$JSON_TARGETS_SUBTARGETS" >> $GITHUB_OUTPUT
98 echo "targets=$JSON_TARGETS" >> $GITHUB_OUTPUT
101 name: Build Kernel with external toolchain
102 needs: determine_targets
109 include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
110 uses: ./.github/workflows/build.yml
112 target: ${{ matrix.target }}
113 subtarget: ${{ matrix.subtarget }}
115 build_all_kmods: true
117 check-kernel-patches:
118 name: Check Kernel patches
119 needs: determine_targets
126 include: ${{fromJson(needs.determine_targets.outputs.targets)}}
127 uses: ./.github/workflows/check-kernel-patches.yml
129 target: ${{ matrix.target }}
130 subtarget: ${{ matrix.subtarget }}