146 lines
3.5 KiB
YAML
146 lines
3.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "feat/**"
|
|
|
|
env:
|
|
CARGO_BUILD_JOBS: "2"
|
|
CARGO_INCREMENTAL: "0"
|
|
RUST_TEST_THREADS: "2"
|
|
TESTCONTAINERS_RYUK_DISABLED: "true"
|
|
|
|
jobs:
|
|
rust:
|
|
name: Rust Checks
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Verify runner toolchain
|
|
run: |
|
|
python3 --version
|
|
rustc --version
|
|
cargo --version
|
|
rustfmt --version
|
|
cargo clippy --version
|
|
docker --version
|
|
docker info
|
|
|
|
- name: Run tooling unit tests
|
|
run: python3 -m unittest discover -s tests/unit
|
|
|
|
- name: Check Community scope
|
|
run: scripts/check-community-scope.sh
|
|
|
|
- name: Check formatting
|
|
run: cargo fmt --all --check
|
|
|
|
- name: Check Rust code health
|
|
run: scripts/check-rust-code-health.sh
|
|
|
|
- name: Check Rust boundaries
|
|
run: scripts/check-rust-boundaries.sh
|
|
|
|
- name: Run clippy
|
|
run: cargo clippy --workspace --all-targets --all-features --jobs "$CARGO_BUILD_JOBS" -- -D warnings
|
|
|
|
- name: Run tests
|
|
run: cargo test --workspace --all-targets --jobs "$CARGO_BUILD_JOBS"
|
|
|
|
ui:
|
|
name: UI Checks
|
|
runs-on: ubuntu-latest
|
|
needs: rust
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Verify runner toolchain
|
|
run: |
|
|
node --version
|
|
npm --version
|
|
docker --version
|
|
|
|
- name: Install UI dependencies
|
|
working-directory: apps/ui
|
|
run: npm ci
|
|
|
|
- name: Build UI bundle
|
|
working-directory: apps/ui
|
|
run: npm run build
|
|
|
|
frontend-e2e:
|
|
name: Frontend E2E
|
|
runs-on: ubuntu-latest
|
|
needs: ui
|
|
services:
|
|
crank-e2e-postgres:
|
|
image: postgres:16-alpine
|
|
env:
|
|
POSTGRES_DB: crank
|
|
POSTGRES_USER: crank
|
|
POSTGRES_PASSWORD: crank
|
|
options: >-
|
|
--health-cmd "pg_isready -U crank -d crank"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
env:
|
|
CRANK_E2E_USE_EXTERNAL_POSTGRES: "1"
|
|
CRANK_E2E_POSTGRES_HOST: crank-e2e-postgres
|
|
CRANK_E2E_POSTGRES_PORT: "5432"
|
|
CRANK_E2E_POSTGRES_DB: crank
|
|
CRANK_E2E_POSTGRES_USER: crank
|
|
CRANK_E2E_POSTGRES_PASSWORD: crank
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Verify runner toolchain
|
|
run: |
|
|
rustc --version
|
|
cargo --version
|
|
node --version
|
|
npm --version
|
|
docker --version
|
|
|
|
- name: Install UI dependencies
|
|
working-directory: apps/ui
|
|
run: npm ci
|
|
|
|
- name: Install Playwright browser
|
|
working-directory: apps/ui
|
|
run: npx playwright install --with-deps chromium
|
|
|
|
- name: Prebuild e2e services
|
|
run: cargo build -p admin-api -p mcp-server --jobs "$CARGO_BUILD_JOBS"
|
|
|
|
- name: Run Playwright e2e
|
|
working-directory: apps/ui
|
|
run: npx playwright test
|
|
|
|
- name: Show Playwright stack logs
|
|
if: failure()
|
|
run: |
|
|
find .tmp/ui-e2e/logs -maxdepth 1 -type f -print -exec sed -n '1,220p' {} \; || true
|
|
|
|
deployment:
|
|
name: Deployment Manifests
|
|
runs-on: ubuntu-latest
|
|
needs: ui
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Validate Community deployment manifest
|
|
run: docker compose -f deploy/community/docker-compose.yml --env-file deploy/community/.env.example config -q
|