As far as i understand, if a job does not have runs-on statement, it can pick any runner. Is there a way to force specific runner to only pick jobs if they have specific runs-on?
Jobs can be forced to run-on a specific runner via label configuration; however, this behavior is not reciprocal. For example:
jobs:
job1:
runs-on: [ubuntu-latest, label1, label2]
- job1 will be only executed by the runner with, at least, the labels ubuntu, label1, label2
You can modify a runner’s labels in several ways. For example, using docker-compose:
...
environment:
GITEA_INSTANCE_URL: "${INSTANCE_URL}"
GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
GITEA_RUNNER_NAME: "${RUNNER_NAME}"
GITEA_RUNNER_LABELS: "${RUNNER_LABELS}" #Following the previous: GITEA_RUNNER_LABELS=ubuntu-latest:docker://gitea/runner-images:ubuntu-latest,label1, label2
...
Note: Be careful when configuring labels. Refer to the documentation for more details.
Are there any plans to implement the possibility for runner to only run labelled jobs?
A use-case for this feature can be implementation of global runner for specific tasks only (e.g. for building containers)
Gitea replicates the functionality of GitHub in this regard. In your case, it might be achievable by using runner groups. Unfortunately, this feature has not yet been implemented in Gitea.