✨(tooling) require PR fields workflow: handle edits on project items #214
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: Ingestion | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| types: [opened, synchronize, reopened, edited] | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| relevant: ${{ steps.filter.outputs.relevant }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d | |
| id: filter | |
| with: | |
| filters: | | |
| relevant: | |
| - "src/ingestion/**" | |
| - ".github/workflows/ingestion.yml" | |
| - ".github/actions/**" | |
| build-ingestion: | |
| needs: check-changes | |
| if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-uv-python | |
| with: | |
| service-path: src/ingestion | |
| lint-ingestion: | |
| needs: [check-changes, build-ingestion] | |
| if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true' | |
| runs-on: ubuntu-latest | |
| services: | |
| postgresql: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: ingestion | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: pass | |
| options: >- | |
| --health-cmd "pg_isready -h localhost -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| ports: | |
| - 5432:5432 | |
| defaults: | |
| run: | |
| working-directory: ./src/ingestion | |
| env: | |
| DATABASE_URL: postgresql+psycopg2://postgres:pass@localhost:5432/ingestion | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-uv-python | |
| with: | |
| service-path: src/ingestion | |
| - name: Lint with Ruff | |
| run: uv run ruff check . | |
| - name: Lint format with Ruff | |
| run: uv run ruff format --check . | |
| - name: Lint with MyPy | |
| run: uv run mypy . | |
| - name: Check no migrations are missing | |
| run: | | |
| uv run alembic upgrade head | |
| uv run alembic check | |
| test-ingestion: | |
| needs: [check-changes, build-ingestion] | |
| if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true' | |
| runs-on: ubuntu-latest | |
| services: | |
| postgresql: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: ingestion | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: pass | |
| options: >- | |
| --health-cmd "pg_isready -h localhost -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| ports: | |
| - 5432:5432 | |
| defaults: | |
| run: | |
| working-directory: ./src/ingestion | |
| env: | |
| DATABASE_URL: postgresql+psycopg2://postgres:pass@localhost:5432/ingestion | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-uv-python | |
| with: | |
| service-path: src/ingestion | |
| - name: Test with pytest | |
| run: uv run pytest --cov=. --cov-report=term-missing --cov-fail-under=95 | |
| deploy-ingestion: | |
| needs: [check-changes, lint-ingestion, test-ingestion] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.check-changes.outputs.relevant == 'true' | |
| runs-on: ubuntu-latest | |
| environment: production | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/scalingo-deploy | |
| with: | |
| branch: main-ingestion |