chore: publish clean community baseline
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- "feat/**"
|
||||
|
||||
env:
|
||||
CARGO_BUILD_JOBS: "2"
|
||||
CARGO_INCREMENTAL: "0"
|
||||
RUST_TEST_THREADS: "2"
|
||||
|
||||
jobs:
|
||||
rust:
|
||||
name: Rust Checks
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
crank-rust-postgres:
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
POSTGRES_DB: crank_test
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres -d crank_test"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
env:
|
||||
TEST_DATABASE_URL: postgres://postgres:postgres@crank-rust-postgres:5432/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: Check formatting
|
||||
run: cargo fmt --all --check
|
||||
|
||||
- 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
|
||||
Reference in New Issue
Block a user