Add full reporting data support #354
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres:18 | |
| ports: | |
| - 55432:5432 | |
| env: | |
| POSTGRES_DB: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.nvmrc | |
| cache: pnpm | |
| - name: Set up .env file | |
| run: | | |
| touch packages/fastify-app/.env | |
| echo DATABASE_URL='postgres://postgres:postgres@localhost:55432/postgres?sslmode=disable&search_path=stripe' >> packages/fastify-app/.env | |
| echo NODE_ENV=dev >> packages/fastify-app/.env | |
| echo STRIPE_SECRET_KEY=sk_test_ >> packages/fastify-app/.env | |
| echo STRIPE_WEBHOOK_SECRET=whsec_ >> packages/fastify-app/.env | |
| echo SCHEMA=stripe >> packages/fastify-app/.env | |
| echo PORT=8080 >> packages/fastify-app/.env | |
| echo API_KEY=api_key_test >> packages/fastify-app/.env | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Formatting checks | |
| run: | | |
| pnpm format:check | |
| - name: Lint | |
| run: | | |
| pnpm lint | |
| - name: Builds successfully | |
| run: | | |
| pnpm build | |
| - name: Initialize DB schema | |
| run: | | |
| docker run --rm \ | |
| --network="host" \ | |
| -e PGPASSWORD=postgres \ | |
| postgres:15 \ | |
| psql -h localhost -p 55432 -U postgres -d postgres -c 'create schema if not exists "stripe";' | |
| - name: Tests | |
| run: | | |
| npm run test | |
| env: | |
| DATABASE_URL: 'postgres://postgres:postgres@localhost:55432/postgres?sslmode=disable&search_path=stripe' | |
| integration-test: | |
| name: CLI Integration Test | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.nvmrc | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build all packages | |
| run: pnpm build | |
| - name: Set up .env file for CLI | |
| run: | | |
| cd packages/sync-engine | |
| touch .env | |
| echo DATABASE_URL='postgresql://postgres:postgres@localhost:5432/app_db' >> .env | |
| echo STRIPE_API_KEY='${{ secrets.STRIPE_API_KEY }}' >> .env | |
| echo STRIPE_API_KEY_2='${{ secrets.STRIPE_API_KEY_2 }}' >> .env | |
| echo STRIPE_API_KEY_3='${{ secrets.STRIPE_API_KEY_3 }}' >> .env | |
| echo NGROK_AUTH_TOKEN='${{ secrets.NGROK_AUTH_TOKEN }}' >> .env | |
| - name: Run CLI Webhook Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-webhooks.sh | |
| ./scripts/test-integration-webhooks.sh | |
| - name: Run CLI Backfill Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-backfill.sh | |
| ./scripts/test-integration-backfill.sh | |
| - name: Run Sync Run Lifecycle Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-sync-run-lifecycle.sh | |
| ./scripts/test-integration-sync-run-lifecycle.sh | |
| - name: Run Sigma Sync Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-sigma.sh | |
| ./scripts/test-integration-sigma.sh | |
| - name: Run CLI Error Recovery Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-recoverable-backfill.sh | |
| ./scripts/test-integration-recoverable-backfill.sh | |
| - name: Run CLI Account Management Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-account-management.sh | |
| ./scripts/test-integration-account-management.sh | |
| - name: Run Webhook Reuse Verification Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-webhook-reuse.sh | |
| ./scripts/test-integration-webhook-reuse.sh | |
| - name: Run Managed WebSocket for Webhooks Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-wss.sh | |
| ./scripts/test-integration-wss.sh | |
| - name: Run Deploy Integration Test | |
| run: | | |
| cd packages/sync-engine | |
| chmod +x ./scripts/test-integration-deploy.sh | |
| ./scripts/test-integration-deploy.sh | |
| env: | |
| SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | |
| SUPABASE_PROJECT_REF: ${{ secrets.SUPABASE_PROJECT_REF }} | |
| STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |