From 2bfa709923f8f70c1318dbb18d3ccc01dd512762 Mon Sep 17 00:00:00 2001 From: Alex Christian Date: Tue, 16 Jun 2026 13:08:20 -0700 Subject: [PATCH] ci: add PR test + lint workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit publish.yml only runs on push to main, so PRs had no test/lint checks. Add a CI workflow that runs on pull_request (and main): ruff lint, a pytest matrix over Python 3.10-3.13 with framework extras installed (so adapter handler tests run, not skip), and a bare .[dev] job that locks the dependency-free contract. SHA-pinned, persist-credentials false, timeouts — matching the org standard. --- .github/workflows/ci.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b30df51 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: '3.13' + - run: python -m pip install --upgrade pip + - run: pip install -e ".[dev]" + - name: Ruff + run: ruff check . + + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: ${{ matrix.python-version }} + - run: python -m pip install --upgrade pip + # Install the framework extras so the adapter handler tests actually run + # (instead of skipping). langchain-core covers the LangChain handler tests. + - run: pip install -e ".[dev,langchain]" + - name: Pytest + run: pytest -q + + test-bare: + # Locks the dependency-free contract: the package and its test suite must + # work with NO framework extra installed (handler tests skip cleanly, no + # import errors). This is what publish.yml runs before releasing. + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: '3.13' + - run: python -m pip install --upgrade pip + - run: pip install -e ".[dev]" + - name: Pytest (no extras) + run: pytest -q