mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-23 23:21:03 -05:00
push self to the test forgejo instance
This commit is contained in:
parent
c92246a058
commit
844a9cd4ff
2 changed files with 15 additions and 18 deletions
|
@ -10,14 +10,5 @@ jobs:
|
||||||
./docker.sh
|
./docker.sh
|
||||||
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19
|
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19
|
||||||
./forgejo-runner.sh setup
|
./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
|
# testdata/run.sh workflow http://root:admin1234@$(cat forgejo-ip):3000 root demo
|
||||||
#
|
testdata/run.sh push_self http://root:admin1234@$(cat forgejo-ip):3000 root
|
||||||
# ...run this integration test (stage 1)
|
|
||||||
#
|
|
||||||
testdata/run.sh self http://root:admin1234@$(cat forgejo-ip):3000 root
|
|
||||||
|
|
22
testdata/run.sh
vendored
22
testdata/run.sh
vendored
|
@ -65,18 +65,24 @@ function workflow() {
|
||||||
wait_success "$forgejo" "$owner/$workflow" $(cat $DIR/$workflow/SHA)
|
wait_success "$forgejo" "$owner/$workflow" $(cat $DIR/$workflow/SHA)
|
||||||
}
|
}
|
||||||
|
|
||||||
function self() {
|
function push_self() {
|
||||||
local forgejo="$1"
|
local forgejo="$1"
|
||||||
local owner="$2"
|
local owner="$2"
|
||||||
|
|
||||||
local dir="$DIR/self"
|
local dir="$DIR/self"
|
||||||
if git remote | grep -q test-setup-forgejo; then
|
local sha=$(git rev-parse HEAD)
|
||||||
git remote rm test-setup-forgejo
|
git clone . $dir
|
||||||
fi
|
(
|
||||||
git remote add test-setup-forgejo $forgejo/$owner/setup-forgejo
|
cd $dir
|
||||||
git push test-setup-forgejo HEAD:main
|
git checkout -b fortesting $sha
|
||||||
|
git remote rm origin
|
||||||
wait_success "$forgejo" "$owner/setup-forgejo" $(git rev-parse HEAD)
|
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
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
Loading…
Reference in a new issue