feat: actions: add LXC backend example (#520)

Without such an example, there is no test that would verify a modification of the ACT LXC backend is working when running a cascading pull request.

Trace of the run at: https://code.forgejo.org/forgejo/end-to-end/actions/runs/2433/jobs/2#jobstep-4-28

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/520
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
Earl Warren 2025-01-28 17:16:51 +00:00 committed by earl-warren
parent 16dba44733
commit 429d5584e1
No known key found for this signature in database
GPG key ID: F128CBE6AB3A7201
5 changed files with 41 additions and 1 deletions

View file

@ -143,7 +143,7 @@ function test_actions() {
done
fi
for example in echo config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do
for example in echo lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do
run actions_verify_example $example
done

View file

@ -0,0 +1,7 @@
on: [push]
jobs:
build:
runs-on: lxc
steps:
- run: systemctl --no-pager list-units

View file

@ -0,0 +1,31 @@
log:
level: debug
job_level: debug
runner:
file: .runner
capacity: 1
env_file: .env
timeout: 3h
insecure: false
fetch_timeout: 5s
fetch_interval: 2s
labels: ["lxc:lxc://debian:bookworm:docker"]
cache:
enabled: false
dir: ""
host: ""
port: 0
container:
network: "bridge"
privileged: false
options:
workdir_parent:
valid_volumes: ["/srv/example"]
docker_host: ""
host:
workdir_parent:

1
actions/example-lxc/setup.sh Executable file
View file

@ -0,0 +1 @@
FORGEJO_RUNNER_CONFIG=$EXAMPLE_DIR/runner-config.yaml forgejo-runner.sh reload

View file

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