Ignore local coverage report artifacts #2
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: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dev dependencies | |
| run: python -m pip install --upgrade pip && pip install -e ".[dev]" | |
| - name: Ruff (lint) | |
| run: ruff check . | |
| - name: Ruff (format check) | |
| run: ruff format --check . | |
| - name: ty (type check) | |
| run: ty check | |
| models-drift: | |
| # src/getitdone_py/models.py is GENERATED from openapi/v1.json. Regenerating | |
| # must produce a zero diff — this fails if someone hand-edited the file or | |
| # updated the spec without re-running the generator. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dev dependencies | |
| run: python -m pip install --upgrade pip && pip install -e ".[dev]" | |
| - name: Regenerate models from the vendored spec | |
| run: bash scripts/regenerate-models.sh | |
| - name: Fail if the generated models changed | |
| run: | | |
| if ! git diff --exit-code -- src/getitdone_py/models.py; then | |
| echo "::error::models.py is out of date. Run scripts/regenerate-models.sh and commit the result." | |
| exit 1 | |
| fi | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dev dependencies | |
| run: python -m pip install --upgrade pip && pip install -e ".[dev]" | |
| - name: Run unit tests | |
| run: pytest tests --ignore=tests/e2e | |
| build-and-import: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Build sdist and wheel | |
| run: python -m pip install --upgrade pip build && python -m build | |
| - name: Install the built wheel and smoke-import it | |
| # Installed from the wheel, run OUTSIDE the source tree, so a packaging | |
| # mistake (missing module, missing py.typed) fails here. | |
| run: | | |
| pip install dist/*.whl | |
| mkdir -p /tmp/wheel-smoke && cd /tmp/wheel-smoke | |
| python -c " | |
| import getitdone_py, pathlib | |
| from getitdone_py import GetItDone, AsyncGetItDone | |
| from getitdone_py.webhooks import verify_webhook | |
| from getitdone_py.models import Task, Problem | |
| assert getitdone_py.__version__ == '0.1.0', getitdone_py.__version__ | |
| marker = pathlib.Path(getitdone_py.__file__).parent / 'py.typed' | |
| assert marker.is_file(), 'py.typed missing from the wheel' | |
| client = GetItDone(api_key='gid_smoke') | |
| assert client.base_url == 'https://app.nowgetitdone.com' | |
| for name in ('organizations','members','projects','tasks','daily_plan','attachments','api_keys','webhook_endpoints','usage'): | |
| assert hasattr(client, name), name | |
| print('wheel smoke OK', getitdone_py.__version__) | |
| " | |
| e2e-smoke: | |
| runs-on: ubuntu-latest | |
| needs: [lint, unit-test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dev dependencies | |
| run: python -m pip install --upgrade pip && pip install -e ".[dev]" | |
| - name: Run the prod smoke | |
| # tests/e2e/test_unauthenticated_prod.py always runs (no secret needed) | |
| # and guards the Cloudflare UA regression. The authenticated module | |
| # skips LOUDLY when the secret is absent, e.g. on forks. | |
| env: | |
| GETITDONE_API_KEY: ${{ secrets.GETITDONE_API_KEY }} | |
| run: pytest tests/e2e -v -rs | |