CI/CD Seed Pipeline

Goal

Generate a test dataset (database seed, fixtures) on every CI run, without depending on real data or on a stateful service: a single HTTP call, no authentication.

One seed per run

Use an identifier of the run itself (GITHUB_RUN_ID) as the seed: each run gets its own data, but re-running the same run (a retry) returns the same dataset.

GitHub Actions

.github/workflows/seed-e2e.yml
name: seed-e2e

on: [pull_request]

jobs:
  seed:
    runs-on: ubuntu-latest
    steps:
      - name: Generate the test dataset
        run: |
          curl -s -X POST "https://datamockseed.firstflip.es/api/v1/es/bulk" \
            -H "Content-Type: application/json" \
            -d '{
              "seed": "run-'"$GITHUB_RUN_ID"'",
              "count": 200,
              "format": "sql",
              "table": "customers_test",
              "createTable": true,
              "fields": [
                { "name": "name", "type": "nombre_completo" },
                { "name": "document", "type": "documento" },
                { "name": "email", "type": "email" },
                { "name": "iban", "type": "iban" }
              ]
            }' > seed.sql

      - name: Load it into the test DB
        run: psql "$DATABASE_URL" -f seed.sql

Why bulk and not generate

POST /v1/es/bulk generates several columns that stay consistent with each other (the email is derived from the name, the document has its check letter) in a single request, and exports straight to SQL, CSV or TypeScript — no post-processing in the pipeline. See /en/docs/api/bulk and the size limit in Rate limits.