openwrt/.github/workflows/label-kernel.yml
Christian Marangi 962334bc82
CI: correctly output subtarget in label workflow
Commit bf8187d5dc ("CI: use split target and subtarget in label
workflow") didn't correctly output subtarget resulting in calling with
an empty subtarget. Fix this and correctly output generated subtarget.

Fixes: bf8187d5dc ("CI: use split target and subtarget in label workflow")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8aa5a86010)
2023-05-25 23:15:26 +02:00

50 lines
1.5 KiB
YAML

# ci:kernel:x86:64 is going to trigger CI kernel check jobs for x86/64 target
name: Build kernel and check patches for target specified in labels
on:
pull_request:
types:
- labeled
jobs:
set_target:
if: startsWith(github.event.label.name, 'ci:kernel:')
name: Set target
runs-on: ubuntu-latest
outputs:
target: ${{ steps.set_target.outputs.target }}
subtarget: ${{ steps.set_target.outputs.subtarget }}
steps:
- name: Set target
id: set_target
env:
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
run: |
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target="\1"/p' | tee --append $GITHUB_OUTPUT
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget="\2"/p' | tee --append $GITHUB_OUTPUT
build_kernel:
name: Build Kernel with external toolchain
needs: set_target
permissions:
contents: read
packages: read
uses: ./.github/workflows/build.yml
with:
target: ${{ needs.set_target.outputs.target }}
subtarget: ${{ needs.set_target.outputs.subtarget }}
build_kernel: true
build_all_kmods: true
check-kernel-patches:
name: Check Kernel patches
needs: set_target
permissions:
contents: read
packages: read
uses: ./.github/workflows/check-kernel-patches.yml
with:
target: ${{ needs.set_target.outputs.target }}
subtarget: ${{ needs.set_target.outputs.subtarget }}