A daemon that connects to a Forgejo instance and runs jobs for continuous integration. The installation and usage instructions are part of the Forgejo documentation https://forgejo.org/docs/latest/admin/actions/
  • Go 88.3%
  • JavaScript 10.1%
  • Shell 1.2%
  • Makefile 0.3%
Find a file
Andreas Ahlenstorf 97f483db58 test: use environment variable for skipping Docker tests (#1585)
Tests involving Docker are skipped when `runtime.GOOS` is not `linux`. That is unnecessarily rigid and hinders development. There are other operating systems that can run Docker. It makes it impossible to run integration tests on Linux without Docker. Verifying that all tests that require Docker are skipped without Docker being present is impossible on Linux due to that, too.

Instead of relying on `runtime.GOOS`, developers can control whether tests involving Docker should be run with the help of the environment variable `TEST_FEATURES`.

If the variable is undefined, tests involving Docker will be run, because they are enabled by default:

```
$ make integration-test
```

That is the same as:

```
$ TEST_FEATURES="docker" make integration-test
```

If the variable does not contain the string `docker`, tests involving Docker will be **skipped**:

```
$ TEST_FEATURES="" make integration-test
```

If a test requires Docker, use `testutils.RequireTestFeatures(t, testutils.TestFeatureDocker)` to indicate that.

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/1585): <!--number 1585 --><!--line 0 --><!--description dGVzdDogdXNlIGVudmlyb25tZW50IHZhcmlhYmxlIGZvciBza2lwcGluZyBEb2NrZXIgdGVzdHM=-->test: use environment variable for skipping Docker tests<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1585
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
2026-07-03 14:52:02 +00:00
.forgejo Update forgejo/forgejo-build-publish to v5.7.2 (#1558) 2026-06-08 20:28:31 +00:00
act test: use environment variable for skipping Docker tests (#1585) 2026-07-03 14:52:02 +00:00
contrib chore: change systemd example TimeoutStopSec -> infinity (#1551) 2026-06-04 13:57:54 +00:00
examples Update dependency forgejo-runner-service-yq to v4.53.3 (#1561) 2026-06-09 00:27:54 +00:00
internal test: use environment variable for skipping Docker tests (#1585) 2026-07-03 14:52:02 +00:00
release-notes feat: add the runner validate subcommand (#757) 2025-07-31 05:37:12 +00:00
testutils test: use environment variable for skipping Docker tests (#1585) 2026-07-03 14:52:02 +00:00
.dockerignore [FORGEJO] build forgejo-runner 2023-08-23 14:44:47 +02:00
.editorconfig Add .editorconfig and .gitattributes (#186) 2023-05-13 23:51:22 +08:00
.gitattributes Add .editorconfig and .gitattributes (#186) 2023-05-13 23:51:22 +08:00
.gitignore fix: unbreak the build for platforms w/o docker support (#1294) 2026-01-14 20:20:05 +00:00
.golangci.yml test: run lint-check during CI, add forbidigo, cleanup linter exclusions (#1181) 2025-11-23 15:01:52 +00:00
.mockery.yml chore: upgrade Mockery to v3 (#1474) 2026-04-05 01:14:44 +00:00
.pre-commit-hooks.yaml fix(pre-commit): don’t default verbose to on (#1015) 2025-09-18 12:02:07 +00:00
CONTRIBUTING.md chore: add issues to README, minimal contribution guide (#1495) 2026-04-25 02:00:01 +00:00
Dockerfile Update data.forgejo.org/oci/alpine Docker tag to v3.23 (#1288) 2026-01-14 16:12:06 +00:00
go.mod Update go toolchain directive to v1.25.11 [SECURITY] (#1548) 2026-06-04 14:58:26 +00:00
go.sum Update module connectrpc.com/connect to v1.20.0 (#1542) 2026-06-01 21:50:31 +00:00
LICENSE chore: change the license to GPLv3-or-later (#773) 2025-09-04 09:26:12 +00:00
main.go fix: unrecoverable errors in artifactcache should have non-zero exit code (#1222) 2025-12-15 14:50:17 +00:00
Makefile ci: add capability to run testing on arm64 (#1546) 2026-06-04 03:46:30 +00:00
README.md chore: add issues to README, minimal contribution guide (#1495) 2026-04-25 02:00:01 +00:00
RELEASE-NOTES.md chore: release notes are now published together with the release (#775) 2025-07-31 08:02:20 +00:00
renovate.json chore(renovate): change name for lxc node version 2026-01-13 11:29:01 +01:00

Forgejo Runner

A daemon that connects to a Forgejo instance and runs jobs for continuous integration. The installation and usage instructions are part of the Forgejo documentation. Forgejo Runner can also run workflows locally and act as a cache.

Forgejo Runner is distributed under the terms of the GPL version 3.0 or any later version.

Issues

It is totally okay to report issues in the "wrong" place; identifying the right place is hard. In the worst case, we will ask you to open it somewhere else because issues cannot be transferred between instances.

Reporting Security Vulnerabilities

Please report security-related issues to security@forgejo.org using encryption.

Contributing

See the contribution guide.

Architectures & OS

The Forgejo runner is supported and tested on amd64 and arm64 (binaries and containers) on Operating Systems based on the Linux kernel.

Work may be in progress for other architectures and you can browse the corresponding issues to figure out how they make progress. If you are interested in helping them move forward, open an issue. The most challenging part is to setup and maintain a native runner long term. Once it is supported by Forgejo, the runner is expected to be available 24/7 which can be challenging. Otherwise debugging any architecture specific problem won't be possible.

Hacking

The Forgejo runner is a dependency of the setup-forgejo action. See the full dependency graph for a global view.

Building

  • Install Go and make(1)
  • make build

Linting

  • make lint-check
  • make lint # will fix some lint errors

Testing

The workflow that runs in the CI uses similar commands.

Without a Forgejo instance

  • Install Docker
  • make test integration-test

The TestRunner_RunEvent test suite contains most integration tests with real-world workflows and is time-consuming to run. During development, it is helpful to run a specific test through a targeted command such as this:

  • go test -count=1 -run='TestRunner_RunEvent$/local-action-dockerfile$' ./act/runner

With a Forgejo instance

  • Run a Forgejo instance locally (for instance at http://0.0.0.0:8080) and create as shared secret
export FORGEJO_RUNNER_SECRET='AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
export FORGEJO_URL=http://0.0.0.0:8080
forgejo forgejo-cli actions register --labels docker --name therunner --secret $FORGEJO_RUNNER_SECRET
  • make test integration-test # which will run addional tests because FORGEJO_URL is set

end-to-end

  • Follow the instructions from the end-to-end tests to run actions tests locally.
  • ./end-to-end.sh actions_teardown # stop the Forgejo and runner daemons running in the end-to-end environment
  • ( cd ~/clone-of-the-runner-repo ; make build ; cp forgejo-runner /tmp/forgejo-end-to-end/forgejo-runner ) # install the runner built from sources
  • ./end-to-end.sh actions_setup 13.0 # start Forgejo v13.0 and the runner daemon in the end-to-end environment
  • ./end-to-end.sh actions_verify_example echo # run the echo workflow
  • xdg-open http://127.0.0.1:3000/root/example-echo/actions/runs/1 # see the logs workflow
  • less /tmp/forgejo-end-to-end/forgejo-runner.log # analyze the runner logs
  • less /tmp/forgejo-end-to-end/forgejo-work-path/log/forgejo.log # analyze the Forgejo logs