Merge pull request #14 from saquibreja7-hash/ui/mobile-menu-and-copy #95
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: [master] | |
| pull_request: | |
| defaults: | |
| run: | |
| working-directory: asmita | |
| jobs: | |
| checks: | |
| name: Lint, types, unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: asmita/package-lock.json | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run type-check | |
| - run: npm run prisma:validate | |
| - run: npm run test | |
| build: | |
| name: Production build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: asmita/package-lock.json | |
| - run: npm ci | |
| - run: npm run build | |
| env: | |
| # Dummy values so the build never needs real secrets; runtime | |
| # secrets live only in Vercel. | |
| DATABASE_URL: postgresql://ci:ci@localhost:5432/ci | |
| ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000" | |
| JWT_SECRET: ci-only-secret | |
| CSRF_SECRET: ci-only-secret | |
| secret-scan: | |
| name: Secret scanning (gitleaks) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: gitleaks/gitleaks-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| security-audit: | |
| name: Dependency audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: asmita/package-lock.json | |
| - run: npm ci | |
| - run: npm run security:audit | |
| e2e: | |
| name: Playwright e2e (with Postgres) | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: asmita | |
| ports: ["5432:5432"] | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/asmita | |
| DIRECT_URL: postgresql://postgres:postgres@localhost:5432/asmita | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: asmita/package-lock.json | |
| - run: npm ci | |
| - run: npx prisma migrate deploy | |
| - run: npx prisma db seed | |
| - run: npx playwright install --with-deps chromium | |
| - run: npx playwright test --project=chromium | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: asmita/playwright-report/ | |
| retention-days: 7 |