feat(onchain): recipient and distributor client-signing seam #332
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: Backend CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'app/backend/**' | |
| pull_request: | |
| branches: [ "main" ] | |
| paths: | |
| - 'app/backend/**' | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_DB: chainforge_test | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_USER: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d chainforge_test" | |
| --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 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate package.json files | |
| run: | | |
| node -e "const fs=require('fs'); require('child_process').execSync('git ls-files \"*package.json\"',{encoding:'utf8'}).trim().split('\\n').filter(Boolean).forEach(p=>{JSON.parse(fs.readFileSync(p,'utf8')); console.log('OK',p)})" | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile --engine-strict=false | |
| - name: Lint | |
| run: pnpm --filter backend run lint | |
| - name: Prepare coverage database | |
| working-directory: app/backend | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainforge_test?schema=public | |
| run: pnpm exec prisma db push --skip-generate | |
| - name: Test with coverage | |
| env: | |
| API_KEY: test-api-key-123 | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainforge_test?schema=public | |
| NODE_ENV: test | |
| REDIS_HOST: 127.0.0.1 | |
| REDIS_PORT: '6379' | |
| run: pnpm --filter backend run test:cov | |
| - name: Test signing specs (real SDK, no mock) | |
| env: | |
| API_KEY: test-api-key-123 | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainforge_test?schema=public | |
| NODE_ENV: test | |
| REDIS_HOST: 127.0.0.1 | |
| REDIS_PORT: '6379' | |
| run: pnpm --filter backend run test:signing | |
| - name: Build | |
| run: pnpm --filter backend run build | |
| - name: Export OpenAPI spec | |
| working-directory: app/backend | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainforge_test?schema=public | |
| NODE_ENV: development | |
| run: npm run spec:export | |
| - name: Regenerate frontend client types | |
| working-directory: app/frontend | |
| run: pnpm generate:api | |
| - name: Check for Prisma schema without migration | |
| run: chmod +x app/backend/scripts/check-prisma-migration.sh && app/backend/scripts/check-prisma-migration.sh | |
| - name: Check for OpenAPI spec drift | |
| run: | | |
| git diff --exit-code app/frontend/openapi.json app/frontend/src/lib/generated/api.ts || \ | |
| (echo "ERROR: openapi.json or api.ts is out of date. Run 'npm run spec:export' in app/backend, then 'pnpm generate:api' in app/frontend, and commit both files." && exit 1) |