Files
tern-server/.gitea/workflows/ci.yml
T
Mateusz PstruchaandClaude Opus 5.5 28a381ffb3
CI / test (push) Successful in 2m19s
Cache only cargo downloads; rust-cache isn't mirrored
The runner resolves actions from git.app.ygg, where Swatinem/rust-cache
doesn't exist, so run #46 failed before checkout. Cache the registry
index, crate archives and git db instead, never target/, under a new
cargo-v2- key so the old target/-laden caches aren't restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:22:21 +01:00

66 lines
2.1 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
# One runner serves all three repos, so a queue is a real cost: superseding
# pushes shouldn't each wait for a full build. Releases deliberately aren't
# covered — cancelling a publish halfway is worse than running it twice.
concurrency:
group: ${{ gitea.workflow }}-${{ gitea.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: rocky-10
steps:
- name: Check out source
uses: actions/checkout@v4
# Gitea rejects a workflow file it can't parse without running
# anything, which for release.yml only shows up when a tag is pushed.
# Parsing them all here catches that on master, before tagging.
- name: Check workflow files parse
run: |
python3 - <<'PY'
import glob, yaml
for f in sorted(glob.glob(".gitea/workflows/*.yml")):
yaml.safe_load(open(f))
print("ok", f)
PY
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
# Downloads only, no target/: caching target/ through the cargo-
# restore prefix saved every stale artifact back, the cache reached
# 1.2 GB and run #40 filled the shared runner's disk. Dependencies are
# recompiled each run instead. (Swatinem/rust-cache would keep them,
# but the runner resolves actions from git.app.ygg and it isn't
# mirrored there.) The key has a v2 prefix so no old cache with target/
# in it is restored.
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: cargo-v2-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-v2-
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
# No DATABASE_URL needed: queries are runtime-checked (sqlx::query_as),
# not compile-time macros, so this builds without a live Postgres.
- name: Test
run: cargo test --all