Fogejo Actions tests
This commit is contained in:
parent
d255395fc8
commit
7ccbeb7a46
34 changed files with 764 additions and 1 deletions
14
actions/example-cron/.forgejo/workflows/test.yml
Normal file
14
actions/example-cron/.forgejo/workflows/test.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
on:
|
||||
schedule:
|
||||
- cron: '* * * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: code.forgejo.org/oci/debian:bookworm
|
||||
options: "--volume /srv/example-cron-volume:/srv/example-cron-volume"
|
||||
|
||||
steps:
|
||||
- run: |
|
||||
touch /srv/example-cron-volume/DONE
|
6
actions/example-cron/run.sh
Executable file
6
actions/example-cron/run.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token
|
||||
# cron runs once per minute, give it three minutes max before declaring failure
|
||||
if ! RETRY_DELAYS="30 30 30 30 30 30" forgejo.sh retry test -f /srv/example-cron-volume/DONE ; then
|
||||
cat $FORGEJO_RUNNER_LOGS
|
||||
false
|
||||
fi
|
30
actions/example-cron/runner-config.yaml
Normal file
30
actions/example-cron/runner-config.yaml
Normal file
|
@ -0,0 +1,30 @@
|
|||
|
||||
log:
|
||||
level: info
|
||||
|
||||
runner:
|
||||
file: .runner
|
||||
capacity: 1
|
||||
env_file: .env
|
||||
timeout: 3h
|
||||
insecure: false
|
||||
fetch_timeout: 5s
|
||||
fetch_interval: 2s
|
||||
labels: ["docker:docker://code.forgejo.org/oci/node:16-bullseye"]
|
||||
|
||||
cache:
|
||||
enabled: false
|
||||
dir: ""
|
||||
host: ""
|
||||
port: 0
|
||||
|
||||
container:
|
||||
network: ""
|
||||
privileged: false
|
||||
options:
|
||||
workdir_parent:
|
||||
valid_volumes: ["/srv/example-cron-volume"]
|
||||
docker_host: ""
|
||||
|
||||
host:
|
||||
workdir_parent:
|
2
actions/example-cron/setup.sh
Executable file
2
actions/example-cron/setup.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
mkdir /srv/example-cron-volume
|
||||
FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload
|
1
actions/example-cron/teardown.sh
Executable file
1
actions/example-cron/teardown.sh
Executable file
|
@ -0,0 +1 @@
|
|||
forgejo-runner.sh reload
|
Loading…
Add table
Reference in a new issue