130 lines
3.1 KiB
YAML
130 lines
3.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "feat/**"
|
|
|
|
jobs:
|
|
rust:
|
|
name: Rust Checks
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TEST_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:55432/crank_test
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Verify runner toolchain
|
|
run: |
|
|
rustc --version
|
|
cargo --version
|
|
rustfmt --version
|
|
cargo clippy --version
|
|
docker --version
|
|
|
|
- name: Start test PostgreSQL
|
|
run: |
|
|
docker rm -f crank-ci-postgres-rust >/dev/null 2>&1 || true
|
|
docker run -d --rm \
|
|
--name crank-ci-postgres-rust \
|
|
-e POSTGRES_DB=crank_test \
|
|
-e POSTGRES_USER=postgres \
|
|
-e POSTGRES_PASSWORD=postgres \
|
|
-p 55432:5432 \
|
|
postgres:16-alpine
|
|
until docker exec crank-ci-postgres-rust pg_isready -U postgres -d crank_test; do
|
|
sleep 1
|
|
done
|
|
|
|
- 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
|
|
|
|
- name: Stop test PostgreSQL
|
|
if: always()
|
|
run: docker rm -f crank-ci-postgres-rust >/dev/null 2>&1 || true
|
|
|
|
ui:
|
|
name: UI Checks
|
|
runs-on: ubuntu-latest
|
|
|
|
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
|
|
|
|
- name: Build UI image
|
|
run: docker build -f apps/ui/Dockerfile .
|
|
|
|
frontend-e2e:
|
|
name: Frontend E2E
|
|
runs-on: ubuntu-latest
|
|
|
|
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
|
|
|
|
- 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
|
|
|
|
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
|