update hacking instructions
This commit is contained in:
parent
b5c5c6b4d5
commit
2db61b4f50
1 changed files with 31 additions and 17 deletions
48
README.md
48
README.md
|
@ -12,25 +12,39 @@ versions compiled from designated repositories.
|
|||
|
||||
## Hacking
|
||||
|
||||
### Local testing
|
||||
To run and debug workflows from `actions/example-*`, from the root of
|
||||
the source directory, with docker and forgejo-curl.sh installed, mimic
|
||||
what `.forgejo/workflows/actions.yml` does. There may be some manual
|
||||
tweaking (such as creating temporary directories) because the tests
|
||||
run as root in the context of Forgejo Actions and assume they have
|
||||
admin permissions. But they do not need to run as root and must work
|
||||
fine when run as a regular user.
|
||||
|
||||
To run and debug workflows from `actions/example-*`, from
|
||||
the root of the source directory, with docker and forgejo-curl.sh
|
||||
installed, mimic what `.forgejo/workflows/actions.yml` does. There
|
||||
may be some manual tweaking (such as creating temporary directories)
|
||||
because the tests run as root, but they do not need to run as root.
|
||||
### Prepare the Forgejo instance and the runner
|
||||
|
||||
* `forgejo-curl.sh logout`
|
||||
* `forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo 1.21`
|
||||
* `firefox http://$(cat forgejo-ip):3000`
|
||||
* `forgejo-runner.sh setup`
|
||||
* `export example=pull-request`
|
||||
* `export EXAMPLE_DIR=$(pwd)/actions/example-$example`
|
||||
* `$EXAMPLE_DIR/setup.sh` # if it exists
|
||||
* `$EXAMPLE_DIR/run.sh` or
|
||||
* `forgejo-test-helper.sh run_workflow actions/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token)`
|
||||
* `forgejo-runner.sh teardown`
|
||||
* `forgejo.sh teardown`
|
||||
```sh
|
||||
git clone https://code.forgejo.org/actions/setup-forgejo
|
||||
export PATH=$(pwd)/setup-forgejo:$PATH
|
||||
git clone https://code.forgejo.org/forgejo/end-to-end
|
||||
cd end-to-end
|
||||
forgejo-curl.sh logout
|
||||
forgejo-runner.sh teardown
|
||||
forgejo.sh teardown
|
||||
forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo 1.21
|
||||
forgejo-runner.sh setup
|
||||
export url=http://root:admin1234@$(cat forgejo-ip):3000
|
||||
export token=$(cat forgejo-token)
|
||||
```
|
||||
### Run a single test
|
||||
|
||||
```sh
|
||||
export example=pull-request
|
||||
export EXAMPLE_DIR=$(pwd)/actions/example-$example
|
||||
sudo rm -fr /srv/example-$example ; mkdir /srv/example-$example
|
||||
$EXAMPLE_DIR/setup.sh
|
||||
$EXAMPLE_DIR/run.sh
|
||||
forgejo-test-helper.sh run_workflow actions/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token)
|
||||
```
|
||||
|
||||
### Remote testing
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue