Files
ystp/.gitea/workflows/ci.yml
237899745 86da5cf1f5
Some checks failed
CI / verify (push) Has been cancelled
perf: harden quotas and reduce compression overhead
2026-07-25 23:10:59 +08:00

64 lines
1.5 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Verify migration line endings
run: |
python3 - <<'PY'
from pathlib import Path
invalid = []
for path in sorted(Path("migrations").glob("*.sql")):
data = path.read_bytes()
if b"\n" in data.replace(b"\r\n", b""):
invalid.append(str(path))
if invalid:
raise SystemExit("migrations must use CRLF: " + ", ".join(invalid))
PY
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: '1.92'
components: rustfmt, clippy
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
- name: Check Rust formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Run Rust tests
run: cargo test --all-targets
- name: Install cargo-audit
run: cargo install cargo-audit --locked --version 0.22.2
- name: Audit Rust dependencies
run: cargo audit
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
working-directory: frontend
run: npm ci && npm run build