From 4fe4c99bd06f1bc89b76bf28588197c3f6c828da Mon Sep 17 00:00:00 2001 From: Guanquan Tian Date: Thu, 6 Aug 2026 01:29:27 +0800 Subject: [PATCH] ci(build-kernel): flavours as space-separated names, indep always built, explicit s3_prefix Rename the flavor input to flavours and switch from a comma-separated token list to space-separated flavour names, matching how Canonical declares flavours in debian.qcom/rules.d/arm64.mk (e.g. "qcom qcom-rt"). binary-indep is no longer an optional token: it is always built alongside the selected flavours, since linux-headers-*/linux-tools-* packages depend on it and previously could be built into an uninstallable combination if the caller omitted it. Replace the S3 upload destination's github.event_name check with an explicit s3_prefix input. A reusable workflow's own github.event_name reflects the caller's original triggering event, not "workflow_call", so premerge-pr.yml calls were always landing under pkg/temp/ instead of the intended pkg/premerge/. Callers now declare their prefix directly. Updates docs/PIPELINE.md to match. Signed-off-by: Guanquan Tian --- .github/workflows/build-kernel.yml | 37 ++++++++++++++++++++++++++---- docs/PIPELINE.md | 8 +++++-- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index dd901bed96bf2..490c988237ce4 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -45,6 +45,11 @@ on: required: false default: true type: boolean + flavours: + description: "ALL builds every flavour. Otherwise a space-separated list of flavour names (e.g. 'qcom', 'qcom qcom-rt'), no 'binary-' prefix." + required: false + default: "ALL" + type: string workflow_call: inputs: @@ -78,6 +83,16 @@ on: required: false default: false type: boolean + flavours: + description: "ALL builds every flavour. Otherwise a space-separated list of flavour names (e.g. 'qcom', 'qcom qcom-rt'), no 'binary-' prefix." + required: false + default: "ALL" + type: string + s3_prefix: + description: "S3 path prefix under pkg/ (e.g. 'premerge', 'temp'). Callers must pass this explicitly." + required: false + default: "temp" + type: string permissions: contents: read # checkout + tag ls-remote only; output goes to S3 @@ -95,7 +110,7 @@ jobs: env: SUITE: ${{ inputs.suite || 'resolute-qcom-devel' }} ARCH: arm64 - FLAVOR: all + FLAVOURS: ${{ inputs.flavours || 'ALL' }} DBGSYM: ${{ github.event_name == 'schedule' && 'true' || (inputs.dbgsym && 'true' || 'false') }} steps: @@ -294,7 +309,18 @@ jobs: - name: Build kernel packages (ghcr.io/qualcomm-linux/pkg-builder:${{ inputs.suite || 'resolute-qcom' }}) run: | JOBS=$(nproc) - if [ "${FLAVOR}" = "all" ]; then TARGET="binary"; else TARGET="binary-${FLAVOR} binary-indep"; fi + FLAVOURS_LC=$(echo "${FLAVOURS}" | tr '[:upper:]' '[:lower:]') + # binary-indep is always built alongside the selected flavours — + # linux-headers-* and linux-tools-* packages depend on it, so it + # can't be made optional here. + if [ "${FLAVOURS_LC}" = "all" ]; then + TARGET="binary" + else + TARGET="binary-indep" + for f in ${FLAVOURS_LC}; do + TARGET="${TARGET} binary-${f}" + done + fi echo "Building: suite=${SUITE} base_suite=${BASE_SUITE} target=${TARGET} arch=${ARCH} jobs=${JOBS}" @@ -416,6 +442,9 @@ jobs: # ----------------------------------------------------------------------- # 9. Upload to S3 (lecore-production runner only) # Skipped when skip_s3 is set (premerge-pr.yml build-only checks). + # Destination prefix is the caller-supplied s3_prefix input, not + # inferred from github.event_name: a reusable workflow inherits the + # caller's original event, so it is never actually "workflow_call". # ----------------------------------------------------------------------- - name: Upload kernel .deb packages to S3 if: inputs.skip_s3 != true @@ -423,7 +452,7 @@ jobs: with: s3_bucket: qli-prd-lecore-gh-artifacts path: ${{ github.workspace }}/output - destination: ${{ env.ORG_NAME }}/pkg/temp/${{ env.REPO_NAME }}/${{ github.run_id }}-${{ github.run_attempt }}/ + destination: ${{ env.ORG_NAME }}/pkg/${{ inputs.s3_prefix || 'temp' }}/${{ env.REPO_NAME }}/${{ github.run_id }}-${{ github.run_attempt }}/ # ----------------------------------------------------------------------- # 10. Summary @@ -440,7 +469,7 @@ jobs: echo "|-------|-------|" echo "| Branch | \`${SUITE}\` |" echo "| Architecture | \`${ARCH}\` |" - echo "| Flavour | \`${FLAVOR}\` |" + echo "| Flavour | \`${FLAVOURS}\` |" echo "| Dbgsym | \`${DBGSYM}\` |" echo "| Container | \`ghcr.io/qualcomm-linux/pkg-builder:${BASE_SUITE}\` |" echo "| Runner | \`${{ runner.name }}\` |" diff --git a/docs/PIPELINE.md b/docs/PIPELINE.md index 4233db986d06e..9c0db701f0320 100644 --- a/docs/PIPELINE.md +++ b/docs/PIPELINE.md @@ -57,6 +57,10 @@ gh workflow run build-kernel.yml --repo qualcomm-linux/pkg-linux-qcom-canonical gh workflow run bootstrap-history.yml --repo qualcomm-linux/pkg-linux-qcom-canonical ``` -PRs into `resolute-qcom-devel` get a build-only pre-merge check (`premerge-pr.yml` -on that branch), which calls `build-kernel.yml` with `skip_s3=true`. +PRs into `resolute-qcom-devel` get a pre-merge build check (`premerge-pr.yml` on +that branch), which calls `build-kernel.yml` with `flavours=qcom`, +`dbgsym=false`, and `s3_prefix=premerge` (binary-indep is always built +regardless of `flavours`). Its packages are uploaded to S3 under +`pkg/premerge/`, separate from the `pkg/temp/` prefix used by nightly and +manual `workflow_dispatch` runs.