fix: add pagination to GET /api/releases endpoint (apn-0d1oa.8) #1233
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: | |
| backend: | |
| name: Backend (.NET) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore PatchNotes.slnx | |
| - name: Build | |
| run: dotnet build PatchNotes.slnx --no-restore --configuration Release | |
| - name: Install EF Core tools | |
| run: dotnet tool install --global dotnet-ef | |
| - name: Check for pending model changes | |
| env: | |
| ConnectionStrings__PatchNotes: ${{ secrets.DATABASE_CONNECTION_STRING }} | |
| run: | | |
| if ! dotnet ef migrations has-pending-model-changes \ | |
| --context SqlServerContext \ | |
| --project PatchNotes.Data \ | |
| --startup-project PatchNotes.Api \ | |
| --configuration Release \ | |
| --no-build; then | |
| echo "" | |
| echo "::error::Model changes detected without a corresponding SQL Server migration!" | |
| echo "" | |
| echo "To fix this, run the following command locally:" | |
| echo "" | |
| echo " ./scripts/add-migration.sh <MigrationName>" | |
| echo "" | |
| echo "See PatchNotes.Data/README.md for more details." | |
| exit 1 | |
| fi | |
| - name: Test | |
| run: dotnet test PatchNotes.slnx --no-build --configuration Release --verbosity normal | |
| - name: Export OpenAPI spec | |
| env: | |
| ASPNETCORE_ENVIRONMENT: Development | |
| ASPNETCORE_URLS: http://localhost:5000 | |
| Stytch__ProjectId: "project-test-00000000-0000-0000-0000-000000000000" | |
| Stytch__Secret: "secret-test-00000000-0000-0000-0000-000000000000" | |
| Stytch__WebhookSecret: "whsec_dummy" | |
| ConnectionStrings__PatchNotes: "Data Source=:memory:" | |
| run: | | |
| dotnet run --project PatchNotes.Api --configuration Release --no-build --no-launch-profile & | |
| APP_PID=$! | |
| for i in $(seq 1 30); do | |
| curl -sf http://localhost:5000/openapi/v1.json -o /tmp/openapi.json && break | |
| sleep 1 | |
| done | |
| kill $APP_PID 2>/dev/null || true | |
| wait $APP_PID 2>/dev/null || true | |
| if [ ! -f /tmp/openapi.json ]; then | |
| echo "::error::Failed to export OpenAPI spec — API did not start" | |
| exit 1 | |
| fi | |
| - name: Check OpenAPI spec is up to date | |
| run: | | |
| # Strip "servers" block (contains localhost URL that varies by environment) | |
| jq 'del(.servers)' patchnotes-web/openapi.json > /tmp/committed.json | |
| jq 'del(.servers)' /tmp/openapi.json > /tmp/exported.json | |
| diff /tmp/committed.json /tmp/exported.json || { | |
| echo "::error::OpenAPI spec is stale! Run the API locally and update patchnotes-web/openapi.json" | |
| exit 1 | |
| } | |
| frontend: | |
| name: Frontend (React) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: patchnotes-web | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --dir ${{ github.workspace }} | |
| - name: Check generated API types are up to date | |
| run: | | |
| pnpm generate:api | |
| git diff --exit-code src/api/generated/ || { | |
| echo "::error::Generated API types are stale! Run 'pnpm generate:api' and commit the result." | |
| exit 1 | |
| } | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Format check | |
| run: pnpm format:check | |
| - name: Run tests | |
| run: pnpm test:run | |
| - name: Type check and build | |
| run: pnpm build | |
| email-function: | |
| name: Email Function (Node.js) | |
| needs: schema-drift | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: patchnotes-email | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --dir ${{ github.workspace }} | |
| - name: Build | |
| run: pnpm build | |
| schema-drift: | |
| name: Prisma Schema Drift Check | |
| runs-on: ubuntu-latest | |
| services: | |
| sqlserver: | |
| image: mcr.microsoft.com/mssql/server:2022-latest | |
| env: | |
| ACCEPT_EULA: Y | |
| MSSQL_SA_PASSWORD: Passw0rd_CI_2024 | |
| ports: | |
| - 1433:1433 | |
| options: >- | |
| --health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Passw0rd_CI_2024' -C -Q 'SELECT 1' || exit 1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| --health-start-period 30s | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore and build | |
| run: dotnet build PatchNotes.slnx --configuration Release | |
| - name: Install EF Core tools | |
| run: dotnet tool install --global dotnet-ef | |
| - name: Apply EF Core migrations to SQL Server | |
| env: | |
| ConnectionStrings__PatchNotes: "Server=localhost,1433;Database=PatchNotes;User Id=sa;Password=Passw0rd_CI_2024;TrustServerCertificate=True" | |
| run: | | |
| dotnet ef database update \ | |
| --context SqlServerContext \ | |
| --project PatchNotes.Data \ | |
| --startup-project PatchNotes.Api \ | |
| --configuration Release \ | |
| --no-build | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Pull schema from database | |
| env: | |
| DATABASE_URL: "sqlserver://localhost:1433;database=PatchNotes;user=sa;password=Passw0rd_CI_2024;trustServerCertificate=true" | |
| working-directory: patchnotes-email | |
| run: pnpm db:pull | |
| - name: Check Prisma schema is up to date | |
| run: | | |
| git diff --exit-code patchnotes-email/prisma/schema.prisma || { | |
| echo "" | |
| echo "::error::Prisma schema is out of sync with database. Run 'cd patchnotes-email && pnpm db:pull && pnpm db:generate' and commit the changes." | |
| exit 1 | |
| } |