Integration Tests #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| # Nightly at 3am UTC — catches flaky regressions on main | |
| - cron: '0 3 * * *' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| # Cancel in-progress runs for the same PR/branch | |
| concurrency: | |
| group: integration-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # ── T1: Rust HTTP + Postgres ────────────────────────────────────── | |
| t1-rust-http-postgres: | |
| name: "T1: Rust HTTP + Postgres" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: testuser | |
| POSTGRES_PASSWORD: testpass | |
| POSTGRES_DB: testdb | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U testuser" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| --tmpfs /var/lib/postgresql/data | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-wasip2 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install wasmtime | |
| uses: bytecodealliance/actions/wasmtime/setup@v1 | |
| with: | |
| version: "v41.0.0" | |
| - name: Build T1 | |
| run: cargo build -p t1-rust-http-postgres 2>&1 || echo "BUILD_FAILED" | |
| continue-on-error: true | |
| id: build | |
| - name: Test T1 | |
| if: steps.build.outcome == 'success' | |
| run: cargo test -p t1-rust-http-postgres | |
| env: | |
| DATABASE_URL: "postgres://testuser:testpass@localhost:5432/testdb" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-t1 | |
| path: test-results/t1-* | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| # ── T3: Go HTTP + Postgres ──────────────────────────────────────── | |
| t3-go-http-postgres: | |
| name: "T3: Go HTTP + Postgres" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Build & Test T3 | |
| run: test-apps/t3-go-http-postgres/test.sh | |
| env: | |
| DATABASE_URL: "postgres://testuser:testpass@localhost:5432/testdb" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-t3 | |
| path: test-results/t3-* | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| # ── T4: TypeScript HTTP + Postgres ───────────────────────────────── | |
| t4-ts-http-postgres: | |
| name: "T4: TypeScript HTTP + Postgres" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install wasm-tools | |
| run: cargo install wasm-tools | |
| - name: Cache ComponentizeJS | |
| uses: actions/cache@v4 | |
| with: | |
| path: build/componentize-js/node_modules | |
| key: componentize-js-npm-${{ hashFiles('scripts/build-componentize-js.sh') }} | |
| - name: Build ComponentizeJS toolchain | |
| run: scripts/build-componentize-js.sh --npm | |
| - name: Install T4 dependencies | |
| run: npm ci --prefix test-apps/t4-ts-http-postgres | |
| - name: Build & Test T4 | |
| run: test-apps/t4-ts-http-postgres/test.sh | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-t4 | |
| path: test-results/t4-* | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| # ── T5: Bun HTTP + Postgres ──────────────────────────────────────── | |
| t5-bun-http-postgres: | |
| name: "T5: Bun HTTP + Postgres" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install wasm-tools | |
| run: cargo install wasm-tools | |
| - name: Cache ComponentizeJS | |
| uses: actions/cache@v4 | |
| with: | |
| path: build/componentize-js/node_modules | |
| key: componentize-js-npm-${{ hashFiles('scripts/build-componentize-js.sh') }} | |
| - name: Build ComponentizeJS toolchain | |
| run: scripts/build-componentize-js.sh --npm | |
| - name: Install T5 dependencies | |
| run: bun install --frozen-lockfile --cwd test-apps/t5-bun-http-postgres | |
| - name: Build & Test T5 | |
| run: test-apps/t5-bun-http-postgres/test.sh | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-t5 | |
| path: test-results/t5-* | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| # ── T6: Multi-service polyglot ───────────────────────────────────── | |
| t6-multi-service: | |
| name: "T6: Multi-service Polyglot" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: testuser | |
| POSTGRES_PASSWORD: testpass | |
| POSTGRES_DB: testdb | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U testuser" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| --tmpfs /var/lib/postgresql/data | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-wasip2 | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install wasmtime | |
| uses: bytecodealliance/actions/wasmtime/setup@v1 | |
| with: | |
| version: "v41.0.0" | |
| - name: Install wasm-tools | |
| run: cargo install wasm-tools | |
| - name: Cache ComponentizeJS | |
| uses: actions/cache@v4 | |
| with: | |
| path: build/componentize-js/node_modules | |
| key: componentize-js-npm-${{ hashFiles('scripts/build-componentize-js.sh') }} | |
| - name: Build ComponentizeJS toolchain | |
| run: scripts/build-componentize-js.sh --npm | |
| - name: Build all T6 services | |
| run: | | |
| echo "Building gateway (Rust)..." | |
| cargo build -p t6-gateway-svc 2>&1 || echo "WARN: T6 gateway build skipped (crate may not exist yet)" | |
| echo "Building user-svc (Go)..." | |
| if [ -f test-apps/t6-multi-service/user-svc/build.sh ]; then | |
| test-apps/t6-multi-service/user-svc/build.sh --standalone | |
| else | |
| echo "WARN: T6 user-svc build.sh not found — skipping" | |
| fi | |
| echo "Building notification-svc (TypeScript)..." | |
| if [ -f test-apps/t6-multi-service/notification-svc/build.sh ]; then | |
| test-apps/t6-multi-service/notification-svc/build.sh --standalone | |
| else | |
| echo "WARN: T6 notification-svc build.sh not found — skipping" | |
| fi | |
| echo "Building analytics-svc (Bun)..." | |
| if [ -f test-apps/t6-multi-service/analytics-svc/build.sh ]; then | |
| test-apps/t6-multi-service/analytics-svc/build.sh --standalone | |
| else | |
| echo "WARN: T6 analytics-svc build.sh not found — skipping" | |
| fi | |
| - name: Test T6 multi-service integration | |
| run: | | |
| if [ -f scripts/test-all.sh ]; then | |
| scripts/test-all.sh --only t6 | |
| elif [ -f test-apps/t6-multi-service/test.sh ]; then | |
| test-apps/t6-multi-service/test.sh | |
| else | |
| echo "T6 integration test script not yet available — skipping" | |
| fi | |
| env: | |
| DATABASE_URL: "postgres://testuser:testpass@localhost:5432/testdb" | |
| REDIS_URL: "redis://localhost:6379" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-t6 | |
| path: test-results/t6-* | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| # ── Summary gate ─────────────────────────────────────────────────── | |
| integration-summary: | |
| name: Integration Summary | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - t1-rust-http-postgres | |
| - t3-go-http-postgres | |
| - t4-ts-http-postgres | |
| - t5-bun-http-postgres | |
| - t6-multi-service | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: test-results/ | |
| pattern: test-results-* | |
| merge-multiple: true | |
| - name: Summary | |
| run: | | |
| echo "## Integration Test Results" >> "$GITHUB_STEP_SUMMARY" | |
| echo "" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| Test App | Status |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "|----------|--------|" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| T1: Rust HTTP + Postgres | ${{ needs.t1-rust-http-postgres.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| T3: Go HTTP + Postgres | ${{ needs.t3-go-http-postgres.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| T4: TypeScript HTTP + Postgres | ${{ needs.t4-ts-http-postgres.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| T5: Bun HTTP + Postgres | ${{ needs.t5-bun-http-postgres.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| T6: Multi-service Polyglot | ${{ needs.t6-multi-service.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "" >> "$GITHUB_STEP_SUMMARY" | |
| FAILED=0 | |
| for result in \ | |
| "${{ needs.t1-rust-http-postgres.result }}" \ | |
| "${{ needs.t3-go-http-postgres.result }}" \ | |
| "${{ needs.t4-ts-http-postgres.result }}" \ | |
| "${{ needs.t5-bun-http-postgres.result }}" \ | |
| "${{ needs.t6-multi-service.result }}"; do | |
| if [ "$result" = "failure" ]; then | |
| FAILED=$((FAILED + 1)) | |
| fi | |
| done | |
| if [ "$FAILED" -gt 0 ]; then | |
| echo "**$FAILED test app(s) failed.**" >> "$GITHUB_STEP_SUMMARY" | |
| exit 1 | |
| else | |
| echo "All integration tests passed." >> "$GITHUB_STEP_SUMMARY" | |
| fi |