diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index 9af179c..67c6847 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -10,14 +10,5 @@ jobs: ./docker.sh ./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19 ./forgejo-runner.sh setup - # - # Can this Forgejo & runner combination... - # - # - # ...run a demo workflow (stage 0) - # # testdata/run.sh workflow http://root:admin1234@$(cat forgejo-ip):3000 root demo - # - # ...run this integration test (stage 1) - # - testdata/run.sh self http://root:admin1234@$(cat forgejo-ip):3000 root + testdata/run.sh push_self http://root:admin1234@$(cat forgejo-ip):3000 root diff --git a/testdata/run.sh b/testdata/run.sh index 6f7c4c5..5cff054 100755 --- a/testdata/run.sh +++ b/testdata/run.sh @@ -65,18 +65,24 @@ function workflow() { wait_success "$forgejo" "$owner/$workflow" $(cat $DIR/$workflow/SHA) } -function self() { +function push_self() { local forgejo="$1" local owner="$2" local dir="$DIR/self" - if git remote | grep -q test-setup-forgejo; then - git remote rm test-setup-forgejo - fi - git remote add test-setup-forgejo $forgejo/$owner/setup-forgejo - git push test-setup-forgejo HEAD:main - - wait_success "$forgejo" "$owner/setup-forgejo" $(git rev-parse HEAD) + local sha=$(git rev-parse HEAD) + git clone . $dir + ( + cd $dir + git checkout -b fortesting $sha + git remote rm origin + git remote add origin $forgejo/$owner/setup-forgejo + git rm -r .forgejo + git config user.email root@example.com + git config user.name username + git commit -m 'avoid workflow infinite recursion' + git push origin fortesting:main + ) } "$@"