Merge pull request #732 from kingeligma/fix/744-implement-high-throug… #3
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| secret-hygiene: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Fail if any .env file is tracked by git | |
| run: node .husky/check-env.js --tracked | |
| backend-checks: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: crowdpay_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: backend/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./backend | |
| run: npm ci | |
| - name: Audit backend dependencies | |
| working-directory: ./backend | |
| run: npm audit --omit=dev --audit-level=high | |
| - name: Run linter | |
| working-directory: ./backend | |
| run: npm run lint | |
| - name: Run migrations | |
| working-directory: ./backend | |
| env: | |
| DATABASE_URL: postgresql://postgres:password@localhost:5432/crowdpay_test | |
| run: npm run migrate | |
| - name: Run test suite | |
| working-directory: ./backend | |
| env: | |
| DATABASE_URL: postgresql://postgres:password@localhost:5432/crowdpay_test | |
| JWT_SECRET: testsecret | |
| PLATFORM_SECRET_KEY: SCVMQUS5EMTHWBLJTE5XCSCMHB2ZOVKRR4ATVTRPUNRCOGKRENIL3LHR | |
| STELLAR_NETWORK: testnet | |
| STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org | |
| USDC_ISSUER: GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5 | |
| WALLET_ENCRYPTION_KEY: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
| ENABLE_CAMPAIGN_STATUS_CRON: "false" | |
| run: npm test | |
| frontend-checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Audit frontend dependencies | |
| working-directory: ./frontend | |
| run: npm audit --omit=dev --audit-level=high | |
| - name: Run linter | |
| working-directory: ./frontend | |
| run: npm run lint | |
| - name: Run unit tests | |
| working-directory: ./frontend | |
| run: npm test | |
| - name: Run build | |
| working-directory: ./frontend | |
| env: | |
| SENTRY_RELEASE: ${{ github.sha }} | |
| VITE_SENTRY_RELEASE: ${{ github.sha }} | |
| run: npm run build |