Add GitLab CI pipeline

Runs fmt, clippy, and tests on the default branch, then builds release
artifacts. Tag builds attach binaries to a release. Same shape as the
GitHub Actions workflow, ported to shared runners.
This commit is contained in:
katR 2026-09-27 20:52:56 +05:30
parent 11fbf8446b
commit a0a6b032b5

47
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,47 @@
stages:
- check
- build
variables:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
cache:
key:
files:
- backend/Cargo.lock
prefix: cargo-backend
paths:
- backend/target/
fmt:
stage: check
image: rust:latest
script:
- rustup component add rustfmt
- cargo fmt --check
- working_directory: backend
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
allow_failure: true
test:
stage: check
image: rust:latest
script:
- cargo test --locked
- working_directory: backend
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
build:
stage: build
image: rust:latest
script:
- cargo build --release --locked
- working_directory: backend
artifacts:
name: "just-download-linux-x86_64"
paths:
- backend/target/release/just-download
expire_in: 30 days