From 2b5ad8d888494ad4c26b2b646d428e1eaaf15c72 Mon Sep 17 00:00:00 2001 From: chexit Date: Thu, 29 Oct 2026 11:55:19 +0300 Subject: [PATCH] CI: build gently (2 jobs, lowest priority), cache only cargo's downloads Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/build.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 31af19d..87f7794 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -9,6 +9,12 @@ on: env: CARGO_TERM_COLOR: never + # The runner shares its machine with Gitea: two compile jobs at a time, no incremental + # files, so the build doesn't starve the server (Gitea answered 500 under a full build). + CARGO_BUILD_JOBS: "2" + CARGO_INCREMENTAL: "0" + # Lowest CPU priority for the long steps (ionice too where the image has it, below). + LOW: nice -n 19 jobs: build: @@ -20,25 +26,29 @@ jobs: SUDO=$(command -v sudo || true) $SUDO apt-get update -qq $SUDO apt-get install -y -qq build-essential pkg-config libasound2-dev libudev-dev + - name: Низкий приоритет + run: command -v ionice >/dev/null && echo "LOW=nice -n 19 ionice -c 3" >> "$GITHUB_ENV" || true - name: Rust run: | curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --target wasm32-unknown-unknown echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + # Only the small things are cached: the build's target folder is gigabytes, and moving it + # through the cache server timed out and loaded the machine. - uses: actions/cache@v3 + continue-on-error: true with: path: | - ~/.cargo/bin/cargo-horizon-mod - ~/.cargo/registry - ~/.cargo/git - horizon/target - key: build-${{ hashFiles('HORIZON_COMMIT', 'horizon-patches/*') }} - restore-keys: build- + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + key: cargo-${{ hashFiles('HORIZON_COMMIT') }} + restore-keys: cargo- - name: Форк Horizon - run: python3 tools/airdef.py fork + run: $LOW python3 tools/airdef.py fork - name: Мод - run: python3 tools/airdef.py mod + run: $LOW python3 tools/airdef.py mod - name: Игра - run: python3 tools/airdef.py game + run: $LOW python3 tools/airdef.py game - name: Архивы run: | mkdir -p out