From c51cee9f93382fba46b804330285c2447453a6ff Mon Sep 17 00:00:00 2001 From: servius Date: Mon, 11 May 2026 10:47:38 +0530 Subject: [PATCH] ci: keep gitea log channel alive during long nix builds Empty act_runner config left log streaming on defaults; long darwin builds on the shiro runner silently outlived the gitea backend's log connection, so jobs appeared "failed" while the runner kept building. - Set explicit runner timeout/fetch/report intervals on shiro - Stream build output with --print-build-logs and a 60s heartbeat so the log channel never goes silent Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/build.yaml | 11 +++++++++-- darwin/shiro/services/gitea-runner.nix | 10 +++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f101264..65fc235 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -28,7 +28,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build ${{ matrix.host }} - run: nix build .#${{ matrix.flake }} --no-link --print-out-paths --show-trace + run: | + ( while true; do printf '[heartbeat %s]\n' "$(date -u +%H:%M:%SZ)" >&2; sleep 60; done ) & + hb=$! + trap 'kill $hb 2>/dev/null || true' EXIT + nix build .#${{ matrix.flake }} --no-link --print-out-paths --print-build-logs --show-trace build-darwin: name: Build ${{ matrix.host }} @@ -47,5 +51,8 @@ jobs: - uses: actions/checkout@v4 - name: Build ${{ matrix.host }} run: | - out=$(nix build .#${{ matrix.flake }} --no-link --print-out-paths --show-trace) + ( while true; do printf '[heartbeat %s]\n' "$(date -u +%H:%M:%SZ)" >&2; sleep 60; done ) & + hb=$! + trap 'kill $hb 2>/dev/null || true' EXIT + out=$(nix build .#${{ matrix.flake }} --no-link --print-out-paths --print-build-logs --show-trace) if [ "$GITHUB_REF" = "refs/heads/master" ]; then nix copy --to "$CACHE_HOST" "$out" -j 4; fi diff --git a/darwin/shiro/services/gitea-runner.nix b/darwin/shiro/services/gitea-runner.nix index b754c54..7e22f78 100644 --- a/darwin/shiro/services/gitea-runner.nix +++ b/darwin/shiro/services/gitea-runner.nix @@ -20,7 +20,15 @@ labelsSorted = builtins.concatStringsSep "\n" (builtins.sort builtins.lessThan labels); settingsFormat = pkgs.formats.yaml {}; - configFile = settingsFormat.generate "runner-config.yaml" {}; + configFile = settingsFormat.generate "runner-config.yaml" { + log.level = "info"; + runner = { + timeout = "6h"; + fetch_timeout = "30s"; + fetch_interval = "2s"; + report_interval = "1s"; + }; + }; hostPackages = with pkgs; [ bash -- 2.51.2