From 1fbbc4277c7275ebfcc1f15e6f96bc10c8c3b1e2 Mon Sep 17 00:00:00 2001 From: Mathieu Fenniak Date: Tue, 30 Dec 2025 14:49:39 +0000 Subject: [PATCH] test: add reusable workflow expansion test for inputs (#1323) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1323 Co-authored-by: Mathieu Fenniak Co-committed-by: Mathieu Fenniak --- .../.forgejo/workflows/reusable-layer-1.yml | 11 +++++++++++ .../.forgejo/workflows/reusable-layer-2.yml | 12 ++++++++++++ .../.forgejo/workflows/test.yml | 2 ++ 3 files changed, 25 insertions(+) diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml index bc0b7dc9..c6b165b5 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml @@ -1,5 +1,9 @@ on: workflow_call: + inputs: + input1: + required: true + type: string outputs: output1: value: ${{ jobs.callee-1.outputs.job-output }} @@ -20,11 +24,18 @@ jobs: volumes: - /srv/example:/srv/example steps: + - name: verify workflow inputs + run: | + set -x + test "top-level-input1" = "${{ inputs.input1 }}" - name: indicate callee-1 hit run: touch /srv/example/callee-1 layer-2: uses: ./.forgejo/workflows/reusable-layer-2.yml + with: + input1: ${{ inputs.input1 }} + input2: mid-level-input2 callee-2: needs: [callee-1, layer-2] diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml index 1633ff7c..099c0331 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml @@ -1,5 +1,12 @@ on: workflow_call: + inputs: + input1: + required: true + type: string + input2: + required: true + type: string outputs: output3: value: ${{ jobs.callee-3.outputs.job-output }} @@ -16,6 +23,11 @@ jobs: volumes: - /srv/example:/srv/example steps: + - name: verify workflow inputs + run: | + set -x + test "top-level-input1" = "${{ inputs.input1 }}" + test "mid-level-input2" = "${{ inputs.input2 }}" - name: indicate callee-3 hit run: touch /srv/example/callee-3 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml index 564475ec..29e04d80 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -4,6 +4,8 @@ on: jobs: layer-1: uses: ./.forgejo/workflows/reusable-layer-1.yml + with: + input1: top-level-input1 verify: needs: [layer-1]