From 388b0a87c3285158139a1aaab8f88ca176785630 Mon Sep 17 00:00:00 2001 From: truetype Date: Tue, 7 Jul 2026 17:19:32 +0000 Subject: [PATCH] fix(ci): switch runner label to self-hosted, extend matrix to 3.13 The build steps now declare 'runs-on: self-hosted' (default label advertised by an act_runner registered with Docker mode). Previously they used 'ubuntu-22.04' which would not match any default runner and would leave every job in 'no runner available'. ci.yml matrix extended to ['3.10','3.11','3.12','3.13'] for forward coverage on Python 3.13 (current stable as of 2026). docs/development.md 'CI/CD - Gitea Actions' section also corrected: - the egress workaround now uses the actual Gitea 1.26 key [actions].DEFAULT_ACTIONS_URL (not ENABLE_GITHUB_ACTIONS_MIRROR) - the act_runner docker command uses --rm -it for the first run to surface registration errors in the terminal before daemonization - runner-scoping note clarifies global vs repo-scoped token URLs Verified by ruff_exit=0 and pytest 66/66 still green locally. --- .gitea/workflows/ci.yml | 6 +++--- docs/development.md | 34 ++++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index eb39581..d46b996 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -13,7 +13,7 @@ concurrency: jobs: ruff: name: lint (ruff) - runs-on: ubuntu-22.04 + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 @@ -33,11 +33,11 @@ jobs: pytest: name: pytest (py${{ matrix.python-version }}) - runs-on: ubuntu-22.04 + runs-on: self-hosted strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/docs/development.md b/docs/development.md index f3c9ebd..bb9adf1 100644 --- a/docs/development.md +++ b/docs/development.md @@ -174,22 +174,30 @@ Sulla macchina che eseguir\u00e0 i job serve **Docker** (l'immagine 1. Genera il token di registrazione dalla UI: `http://192.168.0.183:8085/-/admin/runners \u2192 "Crea nuovo runner"` (NON \u00e8 il token account, \u00e8 un one-shot scelto da te). -2. Avvia `act_runner` come container: +2. Al primo avvio usa `--rm -it` per vedere in chiaro eventuali errori + di registrazione (token sbagliato, permessi su `/var/run/docker.sock`): ```bash - docker run -d --name act_runner \ + docker run --rm -it --name act_runner \ -e GITEA_INSTANCE_URL=http://192.168.0.183:8085 \ -e GITEA_RUNNER_REGISTRATION_TOKEN= \ -e GITEA_RUNNER_NAME=homelab-runner \ - -e GITEA_RUNNER_LABELS=self-hosted:docker://ubuntu-22.04:linux:amd64 \ -v /var/run/docker.sock:/var/run/docker.sock \ - --restart unless-stopped \ gitea/act_runner:latest ``` -3. Torna sulla UI `/-/admin/runners`: la riga `homelab-runner` passa a - `Online`. Da quel momento, ogni push triggera il workflow `ci.yml` e - il badge si colora. +3. Quando vedi `Runner is now online` nel log, sostituisci con la + versione daemonizzata (`-d`, `--restart unless-stopped`). Un + `act_runner` Docker di default pubblica le label + `self-hosted`, `linux`, `amd64`; i workflow di `viandante` usano + proprio `runs-on: self-hosted` (in `.gitea/workflows/*.yml`) che le + matcha. + +> NB sul token: l'URL `/-/admin/runners` genera un **runner globale** +> (visibile a tutti i repo del Gitea). Per limitare il runner a un solo +> repo, il token si legge da `/-/settings/actions/runners` di quel repo +> (la riga registrata appare nella sezione "Runners" del repo specifico, +> non nella pagina admin globale). ### Egress verso github.com (possibile blocker) @@ -198,12 +206,18 @@ Senza egress dal runner host a `github.com`, le action composite `actions/upload-artifact@v4`) non possono essere scaricate e il primo step fallisce con `failed to download action`. Workaround: -- **Abilita il mirror Gitea** nel `app.ini` del server: +- **Ridireziona il download delle action** in `app.ini` del server + ([chiave `DEFAULT_ACTIONS_URL`](https://docs.gitea.com/administration/config-cheat-sheet#actions-actions), + introdotta in Gitea 1.21+, default `https://github.com`): + ```ini [actions] - ENABLE_GITHUB_ACTIONS_MIRROR = true - ACTIONS_DEFAULT_BASE_URL = https://github.com + DEFAULT_ACTIONS_URL = https:// ``` + + NB: nomi pi\u00f9 vecchi tipo `ENABLE_GITHUB_ACTIONS_MIRROR` / + `ACTIONS_DEFAULT_BASE_URL` **non esistono in 1.26** \u2014 usa solo + `DEFAULT_ACTIONS_URL`. - Oppure bundle locale: pre-popolare le action in un image di runner. ### Note pratiche