From 33c95e860b8a36254d7725ae27acb9af9a454e78 Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 19 Aug 2025 16:16:53 +0200 Subject: [PATCH 1/2] .github: replace existing artifacts Signed-off-by: Richard Alpe --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 353fef698..c15d94861 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,6 +25,7 @@ jobs: - uses: ncipollo/release-action@v1 with: allowUpdates: true + replacesArtifacts: true omitName: true omitBody: true omitBodyDuringUpdate: true From 7244fad2e88c248c6d3d93eddda66a1d4896ca6e Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Mon, 25 Aug 2025 15:10:31 +0200 Subject: [PATCH 2/2] .github: include flavor in target There are 2 main reasons for this: 1) It's almost impossible to write complex logical expressions in GH workflows. I wanted to pass "" as flavor when not building _minimal. So that the end target string would become TARGET + FLAVOR where FLAVOR is empty, making it x86_64 for example. As it turns out "" is false in GH workflow logical expressions, this in conjunction with the limitations the interpreter has made it hard to actually write sane expressions in the "with:" variables when calling downstream jobs via workflow calls. Here's an example of what I was trying to do and could not: with: flavor: ${{ ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:main') ) && '' || '_minimal' }} As '' is false, the first sets of expressions always evaluates to false making the string "_minimal". I tried bracing this in various ways and to use "null" or various JSON objects, all in vain. 2) It reduces complexity instead of adding additional. Signed-off-by: Richard Alpe --- .github/workflows/build.yml | 22 ++++++---------------- .github/workflows/generic-x86-build.yml | 1 - .github/workflows/test.yml | 24 +++++++++--------------- .github/workflows/trigger.yml | 9 +++------ 4 files changed, 18 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f8b55bd2..81079e598 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,13 +4,9 @@ on: workflow_dispatch: inputs: target: - description: "Build target (e.g. aarch64)" + description: "Build target (e.g. aarch64 or aarch64_minimal)" default: "x86_64" type: string - flavor: - description: 'Optional build flavor (e.g. _minimal)' - default: '' - type: string parallel: description: 'Massive parallel build of each image' default: true @@ -32,10 +28,6 @@ on: name: required: true type: string - flavor: - required: false - type: string - default: '' infix_repo: required: false type: string @@ -48,7 +40,6 @@ on: 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: @@ -96,8 +87,7 @@ jobs: name=${{ env.NAME }} echo "dir=${name}-${target}" >> $GITHUB_OUTPUT echo "tgz=${name}-${target}.tar.gz" >> $GITHUB_OUTPUT - echo "flv=$FLV" >> $GITHUB_OUTPUT - echo "Building target ${target}${FLV}_defconfig" + echo "Building target ${target}_defconfig" - name: Restore Cache of dl/ uses: actions/cache@v4 @@ -116,9 +106,9 @@ jobs: ccache-${{ env.TARGET }}- ccache- - - name: Configure ${{ env.TARGET }}${{ steps.vars.outputs.flv }} + - name: Configure ${{ env.TARGET }} run: | - make ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig + make ${{ env.TARGET }}_defconfig - name: Unit Test ${{ env.TARGET }} run: | @@ -138,9 +128,9 @@ jobs: fi echo "MAKE=$MAKE" >> $GITHUB_OUTPUT - - name: Build ${{ env.TARGET }}${{ steps.vars.outputs.flv }} + - name: Build ${{ env.TARGET }} run: | - echo "Building ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig ..." + echo "Building ${{ env.TARGET }}_defconfig ..." eval "${{ steps.parallel.outputs.MAKE }}" - name: Check SBOM from Build diff --git a/.github/workflows/generic-x86-build.yml b/.github/workflows/generic-x86-build.yml index 3272d52ab..3a624f460 100644 --- a/.github/workflows/generic-x86-build.yml +++ b/.github/workflows/generic-x86-build.yml @@ -35,7 +35,6 @@ jobs: echo "INFIX_BUILD_ID=${{ github.run_id }}" >> $GITHUB_OUTPUT echo "dir=Infix-x86_64" >> $GITHUB_OUTPUT echo "tgz=Infix-x86_64.tar.gz" >> $GITHUB_OUTPUT - echo "flv=_minimal" >> $GITHUB_OUTPUT - name: Configure x86_64_minimal run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef221f6cc..f63827ed9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,10 +17,6 @@ on: name: required: true type: string - flavor: - required: false - type: string - default: '' infix_repo: required: false type: string @@ -35,14 +31,14 @@ on: default: 'test' env: - FLV: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.flavor || inputs.flavor }} + TARGET: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }} INFIX_REPO: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_repo || inputs.infix_repo }} NINEPM_CONF: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ninepm-conf || inputs.ninepm-conf }} TEST_PATH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.test-path || inputs.test-path }} jobs: test: - name: Regression Test ${{ inputs.name }} ${{ inputs.target }} + name: Regression Test ${{ 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, regression ] steps: - name: Checkout infix repo @@ -62,20 +58,18 @@ jobs: >>$GITHUB_ENV fi - echo "flv=$FLV" >> $GITHUB_OUTPUT - - - name: Configure ${{ inputs.target }}${{ steps.vars.outputs.flv }} + - name: Configure ${{ env.TARGET }} run: | - make ${{ inputs.target }}${{ steps.vars.outputs.flv }}_defconfig + make ${{ env.TARGET }}_defconfig - uses: actions/download-artifact@v4 with: pattern: "artifact-*" merge-multiple: true - - name: Restore x86-64${{ steps.vars.outputs.flv }} output/ + - name: Restore ${{ env.TARGET }} output/ run: | - target=${{ inputs.target }} + target=${{ env.TARGET }} name=${{ inputs.name }} ls -l @@ -85,7 +79,7 @@ jobs: tar xf ${name}-${target}.tar.gz ln -s ${name}-${target} images - - name: Regression Test x86_64${{ steps.vars.outputs.flv }} + - name: Regression Test ${{ env.TARGET }} run: | if [ -n "$NINEPM_CONF" ]; then export NINEPM_PROJ_CONFIG="${GITHUB_WORKSPACE}/$NINEPM_CONF" @@ -93,12 +87,12 @@ jobs: fi make test - - name: Publish Test Result for x86_64${{ steps.vars.outputs.flv }} + - name: Publish Test Result for ${{ env.TARGET }} # Ensure this runs even if Regression Test fails if: always() run: cat $TEST_PATH/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY - - name: Generate Test Report for x86_64${{ steps.vars.outputs.flv }} + - name: Generate Test Report for ${{ env.TARGET }} # Ensure this runs even if Regression Test fails if: always() run: | diff --git a/.github/workflows/trigger.yml b/.github/workflows/trigger.yml index 8fe5d0ba7..819e0b09a 100644 --- a/.github/workflows/trigger.yml +++ b/.github/workflows/trigger.yml @@ -14,28 +14,25 @@ jobs: if: startsWith(github.repository, 'kernelkit/') uses: ./.github/workflows/build.yml with: - target: "x86_64" name: "infix" - flavor: "_minimal" + target: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:main')) && 'x86_64' || 'x86_64_minimal' }} build-aarch64: if: startsWith(github.repository, 'kernelkit/') uses: ./.github/workflows/build.yml with: - target: "aarch64" name: "infix" - flavor: "_minimal" + target: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:main')) && 'aarch64' || 'aarch64_minimal' }} test-run-x86_64: if: startsWith(github.repository, 'kernelkit/') needs: build-x86_64 uses: ./.github/workflows/test.yml with: - target: "x86_64" + target: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:main')) && 'x86_64' || 'x86_64_minimal' }} name: "infix" test-publish-x86_64: if: startsWith(github.repository, 'kernelkit/') needs: test-run-x86_64 uses: ./.github/workflows/publish.yml -