From 21321f0196ba83ff394bac2e1dcb438334e0667f Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Mon, 28 Jul 2025 16:17:08 +0200 Subject: [PATCH 1/3] .github: allow upstream workflow caller to set parallel Signed-off-by: Richard Alpe --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69c27f8b4..075087256 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,6 +36,10 @@ on: required: false type: string default: kernelkit/infix + parallel: + required: false + type: boolean + default: false env: FLV: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.flavor || inputs.flavor }} From ea2627d4f69e5b497f270f5033b380459739dc3c Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 29 Jul 2025 08:36:00 +0200 Subject: [PATCH 2/3] .github: remove explicit required from build dispatch Reduce number of lines. Required = false is the default. Signed-off-by: Richard Alpe --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 075087256..1f54bdfaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,17 +5,14 @@ on: inputs: flavor: description: 'Optional build flavor (e.g. _minimal)' - required: false default: '' type: string parallel: description: 'Massive parallel build of each image' - required: false default: true type: boolean infix_repo: description: 'Repo to checkout (for spin overrides)' - required: false default: kernelkit/infix type: string From fc0a68a18a1db0ff109178f4c41ac711a0436b37 Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 29 Jul 2025 08:56:36 +0200 Subject: [PATCH 3/3] .github: add name and target parameter to dispatch build Signed-off-by: Richard Alpe --- .github/workflows/build.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f54bdfaf..027c285e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,10 @@ name: Build on: workflow_dispatch: inputs: + target: + description: "Build target (e.g. aarch64)" + default: "x86_64" + type: string flavor: description: 'Optional build flavor (e.g. _minimal)' default: '' @@ -11,6 +15,10 @@ on: description: 'Massive parallel build of each image' default: true type: boolean + name: + description: "Name (for spin overrides)" + default: "infix" + type: string infix_repo: description: 'Repo to checkout (for spin overrides)' default: kernelkit/infix @@ -39,12 +47,14 @@ on: default: false env: + NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} + TARGET: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }} FLV: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.flavor || inputs.flavor }} INFIX_REPO: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_repo || inputs.infix_repo }} jobs: build: - name: Build ${{ inputs.name }} ${{ inputs.target }} + name: Build ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }} runs-on: [ self-hosted, latest ] strategy: fail-fast: false @@ -81,8 +91,8 @@ jobs: | tee -a $GITHUB_OUTPUT $GITHUB_ENV fi - target=${{ inputs.target }} - name=${{ inputs.name }} + target=${{ env.TARGET }} + name=${{ env.NAME }} echo "dir=${name}-${target}" >> $GITHUB_OUTPUT echo "tgz=${name}-${target}.tar.gz" >> $GITHUB_OUTPUT echo "flv=$FLV" >> $GITHUB_OUTPUT @@ -100,16 +110,16 @@ jobs: uses: actions/cache@v4 with: path: .ccache/ - key: ccache-${{ inputs.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }} + key: ccache-${{ env.TARGET }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }} restore-keys: | - ccache-${{ inputs.target }}- + ccache-${{ env.TARGET }}- ccache- - - name: Configure ${{ inputs.target }}${{ steps.vars.outputs.flv }} + - name: Configure ${{ env.TARGET }}${{ steps.vars.outputs.flv }} run: | - make ${{ inputs.target }}${{ steps.vars.outputs.flv }}_defconfig + make ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig - - name: Unit Test ${{ inputs.target }} + - name: Unit Test ${{ env.TARGET }} run: | make test-unit @@ -127,9 +137,9 @@ jobs: fi echo "MAKE=$MAKE" >> $GITHUB_OUTPUT - - name: Build ${{ inputs.target }}${{ steps.vars.outputs.flv }} + - name: Build ${{ env.TARGET }}${{ steps.vars.outputs.flv }} run: | - echo "Building ${{ inputs.target }}${{ steps.vars.outputs.flv }}_defconfig ..." + echo "Building ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig ..." eval "${{ steps.parallel.outputs.MAKE }}" - name: Check SBOM from Build @@ -151,7 +161,7 @@ jobs: printf "Size of output/images/: " ls -l output/images/ - - name: Prepare ${{ inputs.target }} Artifact + - name: Prepare ${{ env.TARGET }} Artifact run: | cd output/ mv images ${{ steps.vars.outputs.dir }} @@ -161,4 +171,4 @@ jobs: - uses: actions/upload-artifact@v4 with: path: output/${{ steps.vars.outputs.tgz }} - name: artifact-${{ inputs.target }} + name: artifact-${{ env.TARGET }}