1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-07-27 17:28:35 +00:00
Forgejo runner - alpha release, should not be considered secure enough to deploy in production
Find a file
Earl Warren 22a9c49672
fix: reporter.SetOutputs must ignore values that overflow the size (#662)
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/662
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>
2025-07-08 09:02:50 +00:00
.forgejo Update https://data.forgejo.org/actions/setup-forgejo action to v3.0.1 (#676) 2025-07-08 05:05:43 +00:00
.github/workflows chore: s|gitea.com/gitea/act_runner|runner.forgejo.org| 2025-07-03 19:07:02 +02:00
contrib Fix comments in systemd unit service file (#274) 2024-09-18 13:40:32 +00:00
examples feat: lxc-systemd defaults to using Forgejo runner 7.0.0 (#674) 2025-07-07 18:42:22 +00:00
internal fix: reporter.SetOutputs must ignore values that overflow the size (#662) 2025-07-08 09:02:50 +00:00
scripts add instructions to run under systemd user services 2024-02-19 09:09:57 +01: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 chore: remove unused code and comments including gitea 2025-07-03 18:58:11 +02:00
.golangci.yml chore: remove unused code and comments including gitea 2025-07-03 18:58:11 +02:00
Dockerfile Update data.forgejo.org/oci/alpine Docker tag to v3.22 (#616) 2025-06-18 05:43:57 +00:00
go.mod Update module code.forgejo.org/forgejo/act to v1.29.0 (#672) 2025-07-07 14:30:19 +00:00
go.sum Update module code.forgejo.org/forgejo/act to v1.29.0 (#672) 2025-07-07 14:30:19 +00:00
LICENSE chore: update LICENSE year 2025-07-03 18:58:11 +02:00
main.go chore: s|gitea.com/gitea/act_runner|runner.forgejo.org| 2025-07-03 19:07:02 +02:00
Makefile assorted set of fixes and features for rebranding (#652) 2025-07-06 06:59:00 +00:00
README.md chore(tests): add mockery and instructions to use it (#651) 2025-07-03 16:41:05 +00:00
RELEASE-NOTES.md chore(docs): update v7.0.0 release notes (take 6) 2025-07-07 14:39:54 +02:00
renovate.json chore(renovate): drop explicit config in favor of preset 2025-05-12 11:23:24 +02:00

Forgejo Runner

WARNING: this is alpha release quality code and should not be considered secure enough to deploy in production.

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.

Reporting bugs

When filing a bug in the issue tracker, it is very helpful to propose a pull request in the end-to-end tests repository that adds a reproducer. It will fail the CI and unambiguously demonstrate that the problem exists. In most cases it is enough to add a workflow (see the echo example). For more complicated cases it is also possible to add a runner config file as well as shell scripts to setup and teardown the test case (see the service example).

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 depends on a fork of ACT and 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

The test workflow is a full example that builds the binary, runs the tests and launches the runner binary against a live Forgejo instance.

Generate mocks

  • make deps-tools
  • make generate

If there are changes, commit them to the repository.

Local debug

The repositories are checked out in the same directory:

Install dependencies

The dependencies are installed manually or with:

setup-forgejo/forgejo-dependencies.sh

Build the Forgejo runner with the local ACT

The Forgejo runner is rebuilt with the ACT directory by changing the runner/go.mod file to:

replace github.com/nektos/act => ../act

Running:

cd runner ; go mod tidy

Building:

cd runner ; rm -f forgejo-runner ; make forgejo-runner

Launch Forgejo and the runner

A Forgejo instance is launched with:

cd setup-forgejo
./forgejo.sh setup
firefox $(cat forgejo-url)

The user is root with password admin1234. The runner is registered with:

cd setup-forgejo
docker exec --user 1000 forgejo forgejo actions generate-runner-token > forgejo-runner-token
../runner/forgejo-runner register --no-interactive --instance "$(cat forgejo-url)" --name runner --token $(cat forgejo-runner-token) --labels docker:docker://node:20-bullseye,self-hosted:host://-self-hosted,lxc:lxc://debian:bullseye

And launched with:

cd setup-forgejo ; ../runner/forgejo-runner --config runner-config.yml daemon

Note that the runner-config.yml is required in that particular case to configure the network in bridge mode, otherwise the runner will create a network that cannot reach the forgejo instance.

Try a sample workflow

From the Forgejo web interface, create a repository and add the following to .forgejo/workflows/try.yaml. It will launch the job and the result can be observed from the actions tab.

on: [push]
jobs:
  ls:
    runs-on: docker
    steps:
      - uses: actions/checkout@v4
      - run: |
          ls ${{ github.workspace }}