Fogejo Actions tests

This commit is contained in:
Earl Warren 2023-10-28 22:29:04 +02:00
parent d255395fc8
commit 7ccbeb7a46
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
34 changed files with 764 additions and 1 deletions

View 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
View 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

View 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
View file

@ -0,0 +1,2 @@
mkdir /srv/example-cron-volume
FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload

View file

@ -0,0 +1 @@
forgejo-runner.sh reload