From e2a74d4e160967db16a1064363b0706908b7af70 Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:05:14 +0000 Subject: [PATCH] Check out with actions/checkout, pull the job image at boot gitea-runner clones the actions that jobs use with git, so the image needs git-core. With it and Node.js in the job, actions/checkout works, which replaces the hand-written git fetch. gitea-runner.service pulls the image of the linux label before it starts, so the first job after a boot doesn't wait 27 seconds for it. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 13 +++---------- mkosi.conf | 1 + .../usr/lib/systemd/system/gitea-runner.service | 4 ++++ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index da1c6d6..cd1eaf8 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -25,18 +25,11 @@ jobs: contents: read packages: write steps: + # Install tools adds Node.js for actions/checkout. - name: Install tools - run: dnf install -yq mkosi git-core - # Check out fetches the commit with git. gitea-runner 6 removed - # builtin:checkout, and the job image has no Node.js for actions/checkout. + run: dnf install -yq mkosi git-core nodejs - name: Check out - env: - AUTH: "Authorization: token ${{ gitea.token }}" - run: | - git init -q - git -c http.extraHeader="$AUTH" fetch -q --depth 1 \ - "${{ gitea.server_url }}/${{ gitea.repository }}" "${{ gitea.sha }}" - git checkout -q FETCH_HEAD + uses: actions/checkout@v4 - name: Build env: KEY: ${{ secrets.SECUREBOOT_KEY }} diff --git a/mkosi.conf b/mkosi.conf index 5ed3708..a57e886 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -66,6 +66,7 @@ Packages= systemd-pam # Logins get a session. zram-generator-defaults # Swap is compressed in RAM. podman # The runner runs its jobs in containers. + git-core # The runner fetches the actions jobs use. curl procps-ng iproute diff --git a/mkosi.extra/usr/lib/systemd/system/gitea-runner.service b/mkosi.extra/usr/lib/systemd/system/gitea-runner.service index 642633a..5e55291 100644 --- a/mkosi.extra/usr/lib/systemd/system/gitea-runner.service +++ b/mkosi.extra/usr/lib/systemd/system/gitea-runner.service @@ -14,6 +14,10 @@ Requires=podman.socket # HOME holds the cache of actions/cache, next to the registration. Environment=HOME=/var/lib/gitea-runner Environment=DOCKER_HOST=unix:///run/podman/podman.sock +# ExecStartPre pulls the image of the linux label in +# /etc/gitea-runner/config.yaml, so the first job after a boot doesn't wait +# for it. The runner still starts if it fails. +ExecStartPre=-/usr/bin/podman pull -q quay.io/fedora/fedora:45 ExecStart=/usr/bin/gitea-runner -c /etc/gitea-runner/config.yaml daemon Restart=on-failure RestartSec=10s