diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/test.yml b/actions/example-schedule-noncancel/.forgejo/workflows/test.yml new file mode 100644 index 0000000..e0015c3 --- /dev/null +++ b/actions/example-schedule-noncancel/.forgejo/workflows/test.yml @@ -0,0 +1,8 @@ +on: + schedule: + - cron: "* * * * *" +jobs: + test: + runs-on: docker + steps: + - run: sleep 15 diff --git a/actions/example-schedule-noncancel/run.sh b/actions/example-schedule-noncancel/run.sh new file mode 100755 index 0000000..9fa275d --- /dev/null +++ b/actions/example-schedule-noncancel/run.sh @@ -0,0 +1,18 @@ +repo=root/example-$example +# +# push the repository +# +forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token +sha=$(forgejo-test-helper.sh branch_tip $url $repo main) +# +# wait for the workflow (sleep infinity) to start running +# +forgejo-test-helper.sh wait_running $url $repo $sha +# +# push to the same branch +# +forgejo-test-helper.sh push_workflow actions/example-echo $url root example-$example setup-forgejo $token +# +# wait for the workflow to be canceled as a result of the previous push +# +forgejo-test-helper.sh wait_success $url $repo $sha diff --git a/actions/example-schedule-noncancel/teardown.sh b/actions/example-schedule-noncancel/teardown.sh new file mode 100644 index 0000000..ae9987a --- /dev/null +++ b/actions/example-schedule-noncancel/teardown.sh @@ -0,0 +1,4 @@ +# +# this will effectively discard any linger workflow so they do not interfere with other tests +# +forgejo-runner.sh reload