CI: verify example generation is idempotent #59
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: Run tests | |
| on: [push, pull_request] | |
| jobs: | |
| check-examples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - uses: snok/install-poetry@v1 | |
| with: | |
| poetry-version: "2.2.1" | |
| - name: Configure git | |
| run: | | |
| git config --global user.email "me@example.com" | |
| git config --global user.name "My Name" | |
| - name: Regenerate examples | |
| run: | | |
| ./example.sh | |
| (cd flask && ./example.sh) | |
| (cd fastapi && ./example.sh) | |
| - name: Check for changes (excluding lockfiles) | |
| run: git diff --exit-code -- . ':!**/poetry.lock' | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - uses: snok/install-poetry@v1 | |
| with: | |
| poetry-version: "2.2.1" | |
| - name: Configure git | |
| run: | | |
| git config --global user.email "me@example.com" | |
| git config --global user.name "My Name" | |
| - run: ./test.sh | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgrespass@localhost:5432/testdb | |
| - run: ./test.sh | |
| working-directory: flask | |
| - run: ./fastapi/test.sh | |
| env: | |
| DATABASE_URL: postgresql+asyncpg://postgres:postgrespass@localhost:5432/postgres | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_PASSWORD: postgrespass | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 |