CI / test (push) Failing after 1s
The cargo- restore key carried every old artifact into the next save, so the cache reached 1.2 GB and run #40 filled the shared runner's disk. rust-cache keeps compiled dependencies only and prunes stale files before saving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
1.8 KiB
YAML
57 lines
1.8 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
|
|
|
|
# rust-cache, not a plain actions/cache of target/: that one restored
|
|
# through the cargo- prefix and saved everything back, so stale
|
|
# artifacts piled up (1.2 GB by v0.8.4) and run #40 filled the shared
|
|
# runner's disk. rust-cache keeps only compiled dependencies, drops our
|
|
# own crate and stale files before saving, and turns off incremental.
|
|
- name: Cache cargo
|
|
uses: Swatinem/rust-cache@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
|