riftenlabs-indexer/.gitlab-ci.yml
Dagur Valberg Johannsson 0388aa282e
ci: Use lockfile as cache key
This ensures we don't keep stale builds of dependencies around.
2026-02-02 11:52:09 +01:00

60 lines
1.1 KiB
YAML

variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
# Default cache for Rust jobs - keyed on Cargo.lock to prune stale dependencies
.rust_cache: &rust_cache
cache:
key:
files:
- Cargo.lock
paths:
- $CARGO_HOME/bin/
- $CARGO_HOME/registry/index/
- $CARGO_HOME/registry/cache/
- $CARGO_HOME/git/db/
- target/
build-release:
image: rust:latest
<<: *rust_cache
script:
- cargo build --verbose --release
artifacts:
paths:
- target/release/riftenlabs-indexer
expire_in: 30 days
test:
image: rust:latest
<<: *rust_cache
script:
- cargo test --verbose --release
format_check:
image: rust:latest
<<: *rust_cache
script:
- rustup component add rustfmt
- cargo fmt -- --check
clippy:
image: rust:latest
<<: *rust_cache
script:
- rustup component add clippy
- cargo clippy -- -D warnings
linters:
image: python:latest
script:
- ./linters/run_linters.py
build-api-docs:
image: python:latest
script:
- ./contrib/api_doc_generator.py
artifacts:
paths:
- apidoc
expire_in: 30 days