name: Checks on: [push, pull_request] permissions: contents: read jobs: test: runs-on: ubuntu-latest container: node:22-bookworm defaults: run: shell: bash services: postgres: image: postgres:17 env: POSTGRES_PASSWORD: test-only POSTGRES_DB: meguri_test options: >- --health-cmd "pg_isready -U postgres" --health-interval 5s --health-timeout 5s --health-retries 10 env: MEGURI_TEST_DATABASE_URL: postgresql://postgres:test-only@postgres:5432/meguri_test steps: - name: Install build and database tools run: | apt-get update apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev postgresql-client - name: Check PostgreSQL from the job container env: PGCONNECT_TIMEOUT: "5" run: psql "$MEGURI_TEST_DATABASE_URL" -X -v ON_ERROR_STOP=1 -c 'SELECT 1' - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.97.0 with: components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - run: cargo fmt --check - run: cargo clippy --locked --all-targets -- -D warnings - run: cargo test --locked - run: cargo test --locked --tests -- --ignored --test-threads=1 - uses: azure/setup-helm@v4 - name: Helm chart run: | helm lint helm/meguri --strict -f helm/meguri/ci/values.yaml helm template meguri helm/meguri -f helm/meguri/ci/values.yaml > /dev/null - uses: actions/setup-node@v4 with: node-version: 22 cache: npm - run: npm ci - run: npx playwright install --with-deps chromium - name: Browser and API checks env: DATABASE_URL: postgresql://postgres:test-only@postgres:5432/meguri_test MEGURI_SEED_DEMO: "true" MEGURI_DEMO_SANDBOXES: "12" MEGURI_BROWSER_CHANNEL: chromium run: | cargo build --locked target/debug/meguri > server.log 2>&1 & for i in $(seq 1 60); do curl -fsS http://127.0.0.1:3000/health/ready && break || sleep 1; done npm run test:browser - uses: actions/upload-artifact@v4 if: always() with: name: browser-evidence path: | test-results/ server.log