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 <mathieu@fenniak.net> Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
This commit is contained in:
parent
cc2a2e85f7
commit
1fbbc4277c
3 changed files with 25 additions and 0 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ on:
|
|||
jobs:
|
||||
layer-1:
|
||||
uses: ./.forgejo/workflows/reusable-layer-1.yml
|
||||
with:
|
||||
input1: top-level-input1
|
||||
|
||||
verify:
|
||||
needs: [layer-1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue