test: add reusable workflow expansion test (#1316)

end-to-end test covering https://codeberg.org/forgejo/forgejo/pulls/10525.

![image](/attachments/2bca39ea-67d9-4ae6-a940-e2b5f77b11d4)

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:
Mathieu Fenniak 2025-12-28 16:29:05 +00:00 committed by Mathieu Fenniak
parent 37fdd131e2
commit a8a26c9296
3 changed files with 52 additions and 0 deletions

View file

@ -180,5 +180,9 @@ function test_actions() {
if dpkg --compare-versions $version ge 14.0; then
run actions_verify_example matrix-dynamic
fi
if dpkg --compare-versions $version ge 15.0; then
run actions_verify_example workflow-call-expansion
fi
done
}

View file

@ -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

View file

@ -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