Files
crank/.github/workflows/ci.yml
T
2026-03-25 17:19:54 +03:00

59 lines
1.3 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- main
- "feat/**"
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: Rust Checks
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: rmcp_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d rmcp_test"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
TEST_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/rmcp_test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.85.0
components: rustfmt, clippy
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all --check
- name: Check workspace
run: cargo check --workspace
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --workspace --all-targets