fix: recalculateCampaignStats now decrements raisedAmount after refun… #37
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: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install | ||
| run: npm ci | ||
| - name: ESLint | ||
| run: npm run lint | ||
| format: | ||
| name: Format check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install | ||
| run: npm ci | ||
| - name: Prettier check | ||
| run: npx prettier --check "src/**/*.ts" "test/**/*.ts" | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install | ||
| run: npm ci | ||
| - name: Nest build | ||
| run: npm run build | ||
| test: | ||
| name: Test (unit) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install | ||
| run: npm ci | ||
| - name: Jest unit | ||
| run: npm run test | ||
| test-e2e: | ||
| name: Test (e2e) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| services: | ||
| postgres: | ||
| image: postgres:16 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: orbitchain | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| redis: | ||
| image: redis:7 | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install | ||
| run: npm ci | ||
| - name: Generate Prisma client | ||
| run: npx prisma generate | ||
| - name: Push database schema | ||
| run: npx prisma db push | ||
| env: | ||
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/orbitchain?schema=public | ||
| - name: Jest e2e | ||
| # E2e tests need environment variables for Prisma and other services | ||
| # Using placeholder values for CI - tests should mock external dependencies | ||
| env: | ||
| DATABASE_URL: postgresql://test:test@localhost:5432/orbitchain_test | ||
| REDIS_URL: redis://localhost:6379 | ||
| JWT_SECRET: test-secret-for-ci | ||
| NODE_ENV: test | ||
| PORT: 3001 | ||
| run: npm run test:e2e | ||
| env: | ||
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/orbitchain?schema=public | ||
| REDIS_URL: redis://localhost:6379 | ||
| JWT_SECRET: test-secret | ||
| NODE_ENV: test | ||
| prisma-validate: | ||
| name: Prisma validate (optional) | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install | ||
| run: npm ci | ||
| - name: Prisma validate | ||
| # Schema uses `url = env("DATABASE_URL")`; prisma validate only checks | ||
| # schema syntax and does not connect, but it still needs the var to be | ||
| # defined. Inject a dummy URL so the optional job can pass in CI. | ||
| env: | ||
| DATABASE_URL: postgresql://placeholder:placeholder@localhost:5432/placeholder | ||
| run: npx prisma validate | ||