Fix backend, frontend, and contract build/test/lint failures #226
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: Backend CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-ci.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend-ci.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci: | |
| name: Backend | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| env: | |
| REDIS_HOST: 127.0.0.1 | |
| REDIS_PORT: 6379 | |
| NODE_ENV: test | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Start Redis | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y redis-server | |
| sudo systemctl start redis-server | |
| redis-cli ping | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: backend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma client | |
| run: npx prisma generate | |
| - name: Check address normalization | |
| run: npx ts-node -r tsconfig-paths/register src/scripts/normalize-addresses.ts --dry-run | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| - name: Test | |
| run: npm test | |
| - name: Check OpenAPI spec drift | |
| run: npm run export-spec && git diff --exit-code openapi.json | |
| continue-on-error: false | |
| env-parity: | |
| name: Env Parity | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: backend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check .env.example matches env.definitions.ts | |
| run: npm run env:example:check |