From d2e2adf8789ec05dc29c5559e99f414856cd2d2e Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Mon, 24 Nov 2025 10:52:17 +0100 Subject: [PATCH 1/2] CI: add pre-test-script workflow call variable This allows a caller (Spin) to run arbitrary code before test starts. Signed-off-by: Richard Alpe --- .github/workflows/test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa7bd7be..86641835 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,11 @@ on: required: false type: string default: 'test' + pre_test_script: + required: false + type: string + default: '' + description: 'Optional script to run after checkout (for spin customization)' secrets: CHECKOUT_TOKEN: required: false @@ -65,6 +70,15 @@ jobs: submodules: recursive token: ${{ secrets.CHECKOUT_TOKEN || github.token }} + - name: Run pre-test script + if: ${{ inputs.pre_test_script != '' }} + run: | + cat > ./pre-test.sh << 'EOF' + ${{ inputs.pre_test_script }} + EOF + chmod +x ./pre-test.sh + bash ./pre-test.sh + - name: Set Build Variables id: vars run: | From 79ec2fbc306b29925112bf2c5423bba124b81135 Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 25 Nov 2025 09:13:46 +0100 Subject: [PATCH 2/2] CI: allow upstream caller to specify branch Signed-off-by: Richard Alpe --- .github/workflows/build.yml | 12 +++++++++++- .github/workflows/test.yml | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6e6df5f..ef78e059 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,10 @@ on: description: 'Repo to checkout (for spin overrides)' default: kernelkit/infix type: string + infix_branch: + description: 'Branch/tag/commit to checkout (for spin overrides)' + default: '' + type: string workflow_call: inputs: @@ -32,6 +36,11 @@ on: required: false type: string default: kernelkit/infix + infix_branch: + required: false + type: string + default: '' + description: 'Branch/tag/commit to checkout (for spin overrides). Defaults to github.ref if not specified' parallel: required: false type: boolean @@ -50,6 +59,7 @@ 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 }} INFIX_REPO: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_repo || inputs.infix_repo }} + INFIX_BRANCH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_branch || inputs.infix_branch }} jobs: build: @@ -82,7 +92,7 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ env.INFIX_REPO }} - ref: ${{ github.ref }} + ref: ${{ env.INFIX_BRANCH != '' && env.INFIX_BRANCH || github.ref }} clean: true fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 86641835..4f4b8c42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,10 @@ on: required: false default: kernelkit/infix type: string + infix_branch: + description: 'Branch/tag/commit to checkout (for spin overrides)' + default: '' + type: string workflow_call: inputs: @@ -21,6 +25,11 @@ on: required: false type: string default: kernelkit/infix + infix_branch: + required: false + type: string + default: '' + description: 'Branch/tag/commit to checkout (for spin overrides). Defaults to github.ref if not specified' ninepm-conf: required: false type: string @@ -42,6 +51,7 @@ on: env: 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 }} + INFIX_BRANCH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_branch || inputs.infix_branch }} 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 }} @@ -64,7 +74,7 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ env.INFIX_REPO }} - ref: ${{ github.ref }} + ref: ${{ env.INFIX_BRANCH != '' && env.INFIX_BRANCH || github.ref }} clean: true fetch-depth: 0 submodules: recursive