CI: build gently (2 jobs, lowest priority), cache only cargo's downloads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 11:55:19 +03:00
parent 3443bafedf
commit 2b5ad8d888
+19 -9
View File
@@ -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