test: add reusable workflow expansion test (#1316)
end-to-end test covering https://codeberg.org/forgejo/forgejo/pulls/10525.  Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1316 Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net> Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
This commit is contained in:
parent
37fdd131e2
commit
a8a26c9296
3 changed files with 52 additions and 0 deletions
|
|
@ -180,5 +180,9 @@ function test_actions() {
|
||||||
if dpkg --compare-versions $version ge 14.0; then
|
if dpkg --compare-versions $version ge 14.0; then
|
||||||
run actions_verify_example matrix-dynamic
|
run actions_verify_example matrix-dynamic
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if dpkg --compare-versions $version ge 15.0; then
|
||||||
|
run actions_verify_example workflow-call-expansion
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
callee-1:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: data.forgejo.org/oci/node:22-bookworm
|
||||||
|
volumes:
|
||||||
|
- /srv/example:/srv/example
|
||||||
|
steps:
|
||||||
|
- name: indicate callee-1 hit
|
||||||
|
run: touch /srv/example/callee-1
|
||||||
|
|
||||||
|
callee-2:
|
||||||
|
needs: callee-1
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: data.forgejo.org/oci/node:22-bookworm
|
||||||
|
volumes:
|
||||||
|
- /srv/example:/srv/example
|
||||||
|
steps:
|
||||||
|
- name: verify callee-1 completed
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
test -f /srv/example/callee-1
|
||||||
|
- name: indicate callee-2 hit
|
||||||
|
run: touch /srv/example/callee-2
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
caller:
|
||||||
|
uses: ./.forgejo/workflows/reusable.yml
|
||||||
|
|
||||||
|
verify:
|
||||||
|
needs: [caller]
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: data.forgejo.org/oci/node:22-bookworm
|
||||||
|
volumes:
|
||||||
|
- /srv/example:/srv/example
|
||||||
|
steps:
|
||||||
|
- name: verify callee-1 & callee-2 completed
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
test -f /srv/example/callee-1
|
||||||
|
test -f /srv/example/callee-2
|
||||||
Loading…
Add table
Add a link
Reference in a new issue