fix: custom events on funnels and session #10
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| branches: [main, staging] | |
| pull_request: | |
| branches: [main, staging] | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: databuddy_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| clickhouse: | |
| image: clickhouse/clickhouse-server:latest | |
| ports: | |
| - 8123:8123 | |
| - 9000:9000 | |
| env: | |
| CLICKHOUSE_DB: databuddy_test | |
| options: >- | |
| --health-cmd "clickhouse-client --query 'SELECT 1'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run tests | |
| env: | |
| # Database URLs | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/databuddy_test | |
| POSTGRES_URL: postgresql://postgres:postgres@localhost:5432/databuddy_test | |
| # Redis URL | |
| REDIS_URL: redis://localhost:6379 | |
| REDIS_HOST: localhost | |
| REDIS_PORT: 6379 | |
| # ClickHouse URLs | |
| CLICKHOUSE_URL: http://localhost:8123 | |
| CLICKHOUSE_HOST: localhost | |
| CLICKHOUSE_PORT: 8123 | |
| CLICKHOUSE_DATABASE: databuddy_test | |
| # Test environment | |
| NODE_ENV: test | |
| # Auth secrets (use dummy values for tests) | |
| AUTH_SECRET: test-auth-secret-for-ci-testing-only | |
| NEXTAUTH_SECRET: test-auth-secret-for-ci-testing-only | |
| # API keys (use dummy values for tests) | |
| EMAIL_API_KEY: test-email-api-key | |
| IP_HASH_SALT: test-ip-hash-salt | |
| run: bun test | |
| - name: Upload coverage reports | |
| if: always() | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/coverage-final.json | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |