An actions runner based on actions/runner for gitea actions
Go to file
Christopher Homberger 519a862a91
Some checks failed
build/release / goreleaser (push) Has been cancelled
enshure full messages are sent to runner
2024-03-13 20:25:29 +01:00
.gitea/workflows fix release workflow 2023-07-13 15:48:30 +02:00
.github/workflows Add images using catthehacker/ubuntu as the base 2024-02-27 16:29:00 +01:00
actions/server Add artifact / cache support 2023-07-13 15:37:59 +02:00
client Rename to actions (#7) 2022-12-06 16:37:38 +08:00
cmd allow overriding labels via conf/env on each daemon run 2024-02-27 14:18:36 +01:00
config allow overriding labels via conf/env on each daemon run 2024-02-27 14:18:36 +01:00
core cleanup 2023-01-07 13:23:47 +01:00
examples add rootful compose examples/docker-compose-dind 2024-02-27 17:02:28 +01:00
poller Update Poller to use Taskversion 2024-02-27 12:51:22 +01:00
register cleanup 2023-01-07 13:23:47 +01:00
runtime Make ready for artifacts v4 backend 2024-02-23 20:34:30 +01:00
.gitignore Make ready for artifacts v4 backend 2024-02-23 20:34:30 +01:00
.golangci.yml chore: add .golangci config 2022-11-24 15:36:28 +08:00
.goreleaser.checksum.sh Add .goreleaser.checksum.sh 2023-05-19 02:17:01 +08:00
.goreleaser.yaml remove armv5/v6 2023-05-19 02:16:35 +08:00
actions-runner-worker.ps1 fix pwsh worker exitcode 1 never happend 2023-08-31 18:38:38 +02:00
actions-runner-worker.py enshure full messages are sent to runner 2024-03-13 20:25:29 +01:00
Dockerfile Add images using catthehacker/ubuntu as the base 2024-02-27 16:29:00 +01:00
Dockerfile.medium Add images using catthehacker/ubuntu as the base 2024-02-27 16:29:00 +01:00
go.mod Update Poller to use Taskversion 2024-02-27 12:51:22 +01:00
go.sum Update Poller to use Taskversion 2024-02-27 12:51:22 +01:00
LICENSE Add license 2022-11-24 15:36:16 +08:00
main.go Remove old code 2023-01-07 12:20:50 +01:00
Makefile fix version metadata 2024-02-27 13:56:24 +01:00
README.md Make ready for artifacts v4 backend 2024-02-23 20:34:30 +01:00
start.sh Tell actions/runner that it should behave like for GHES 2023-12-14 22:05:25 +01:00

actions runner

Actions runner is a runner for Gitea based on actions/runner and the workflow yaml parser of act.

  • This runner doesn't download actions via the git http protocol, it downloads them via tar.gz and zip archives.
  • This runner doesn't support absolute actions in composite actions https://github.com/actions/checkout@v3 will only work in workflow steps.
  • This runner doesn't support go actions, however you can create a wrapper composite action as a workaround
  • This runner does support service container
  • This runner does support https://github.com/actions/runner-container-hooks
  • This runner uses the official https://github.com/actions/runner runner to run your steps
  • This runner is a protocol proxy between Gitea Actions and GitHub Actions

Known Issues

  • actions/runner's live logs are skipping lines, but it is not possible to upload the full log without breaking live logs after the steps are finished
  • job outputs cannot be sent back gitea/actions-proto-def#4 fixed
  • Not possible to update display name of steps from runner Pre and Post steps are part of setup and complete job, steps not in the job are ignored by the server

Prerequisites

  • Install powershell 7 https://github.com/powershell/powershell (actions-runner-worker.ps1)
    • For linux and macOS you can also use python3 instead (actions-runner-worker.py)
  • Download and extract actions/runner https://github.com/actions/runner/releases
  • You have to create simple .runner file in the root folder of the actions/runner with the following Content
    {"isHostedServer": false, "agentName": "my-runner", "workFolder": "_work"}
    

Quickstart

Build

make build

Register


./gitea-actions-runner register

And you will be asked to input:

  1. worker args for example python3,actions-runner-worker.py,actions-runner/bin/Runner.Worker, pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker actions-runner-worker(.ps1/.py) are wrapper scripts to call the actions/runner via the platform specfic dotnet anonymous pipes

    actions-runner-worker.py doesn't work on windows

    On windows you might need to unblock the actions-runner-worker.ps1 script via pwsh Unblock-File actions-runner-worker.ps1 and Runner.Worker needs the .exe suffix. For example on windows use the following worker args pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker.exe

  2. Gitea instance URL, like http://192.168.8.8:3000/. You should use your gitea instance ROOT_URL as the instance argument and you should not use localhost or 127.0.0.1 as instance IP;

  3. Runner token, you can get it from http://192.168.8.8:3000/admin/runners;

  4. Runner name, you can just leave it blank;

  5. Runner labels, you can just leave it blank.

The process looks like:

INFO Registering runner, arch=amd64, os=darwin, version=0.1.5.
INFO Enter the worker args for example pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker:
pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker
INFO Enter the Gitea instance URL (for example, https://gitea.com/):
http://192.168.8.8:3000/
INFO Enter the runner token:
fe884e8027dc292970d4e0303fe82b14xxxxxxxx
INFO Enter the runner name (if set empty, use hostname:Test.local ):

INFO Enter the runner labels, leave blank to use the default labels (comma-separated, for example, self-hosted,ubuntu-latest):

INFO Registering runner, name=Test.local, instance=http://192.168.8.8:3000/, labels=[self-hosted ubuntu-latest].
DEBU Successfully pinged the Gitea instance server
INFO Runner registered successfully.

You can also register with command line arguments.

./gitea-actions-runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --worker pwsh,actions-runner-worker.ps1,actions-runner/bin/Runner.Worker --no-interactive
./gitea-actions-runner register --instance http://192.168.8.8:3000 --token <my_runner_token> --worker python3,actions-runner-worker.py,actions-runner/bin/Runner.Worker --no-interactive

If the registry succeed, you could run the runner directly.

Run

./gitea-actions-runner daemon

Hosted on both GitHub and Gitea

System Overview

A lot of my projects can communicate through various indirections.

C4_Elements