CI #160
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 | |
| # Weekly + on-demand runs for the heavy real-framework integration matrix below. | |
| schedule: | |
| - cron: '0 6 * * 1' # Mondays 06:00 UTC | |
| workflow_dispatch: {} | |
| jobs: | |
| # Ruff + mypy gate. Both already pass clean on the codebase, so this locks in that state | |
| # and blocks regressions. mypy uses ignore_missing_imports (see [tool.mypy] in | |
| # pyproject.toml), so the heavy framework extras are intentionally NOT installed here — | |
| # the same shape under which the baseline was verified clean. | |
| lint: | |
| name: lint + type-check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install lint/type tools and the package | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff mypy | |
| pip install -e ".[dev]" | |
| - name: Ruff (lint) | |
| run: ruff check dprovenancekit/ | |
| - name: Mypy (type-check) | |
| run: mypy dprovenancekit/ | |
| test: | |
| name: pytest (Python ${{ matrix.python-version }} on ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: | |
| - '3.9' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| # The threaded SQLite writer is only exercised on Linux above. macOS is POSIX-similar | |
| # and the suite passes on Darwin, so add one macOS leg for cheap portability coverage. | |
| # Windows is intentionally omitted: it can't be validated in this environment and its | |
| # different filesystem/locking semantics may surface real failures that would block | |
| # launch CI. TODO(follow-up): add a Windows leg once the writer is validated there. | |
| include: | |
| - os: macos-latest | |
| python-version: '3.12' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package and test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run tests | |
| # -rs surfaces skipped tests (e.g. importorskip-guarded integration tests) in the log | |
| # so a silently-skipping suite is visible rather than looking fully green. --cov prints | |
| # a coverage summary for the package on every leg; there is deliberately no | |
| # --cov-fail-under, so coverage is measured and visible but never gates the build. | |
| run: python -m pytest -rs --cov=dprovenancekit --cov-report=term-missing:skip-covered | |
| # The default `test` job installs only `.[dev]` (which includes langchain-core, so the | |
| # LangChain integration tests run there). The OpenAI Agents, LlamaIndex, and CrewAI | |
| # adapters are advertised integrations, but their extras are heavy and not installed | |
| # above, so their importorskip-guarded tests silently skip on every PR. This job installs | |
| # each real framework and actually exercises the adapter against it. It runs weekly and | |
| # on manual dispatch — never on PRs — so a third-party framework breaking never blocks a | |
| # merge, while the integrations we advertise still get real coverage on a cadence. | |
| integration: | |
| name: real-framework integration (${{ matrix.adapter }}) | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - adapter: openai-agents | |
| extra: openai-agents | |
| tests: tests/test_integration_openai_agents.py | |
| - adapter: llama-index | |
| extra: llama-index | |
| tests: tests/integrations/test_llama_index.py | |
| - adapter: crewai | |
| extra: crewai | |
| tests: tests/integrations/test_crewai.py | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' # crewai/llama-index/openai-agents require >= 3.10 | |
| - name: Install package with the ${{ matrix.adapter }} extra | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev,${{ matrix.extra }}]" | |
| - name: Run ${{ matrix.adapter }} integration tests | |
| run: python -m pytest -q ${{ matrix.tests }} |