diff --git a/actions/actions.sh b/actions/actions.sh index 5ddffd1f..1dc6b14e 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -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 } diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml new file mode 100644 index 00000000..b5bcdde4 --- /dev/null +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable.yml @@ -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 diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml new file mode 100644 index 00000000..484cdc29 --- /dev/null +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -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