fix: Fix compaction-aware session check for lazy sessions for #2196 (… #4009
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| # All PRs, including stacked PRs | |
| permissions: | |
| contents: read | |
| env: | |
| UV_FROZEN: "1" | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| - name: Detect code changes | |
| id: changes | |
| run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}" | |
| - name: Setup uv | |
| if: steps.changes.outputs.run == 'true' | |
| uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| if: steps.changes.outputs.run == 'true' | |
| run: make sync | |
| - name: Verify formatting | |
| if: steps.changes.outputs.run == 'true' | |
| run: make format-check | |
| - name: Run lint | |
| if: steps.changes.outputs.run == 'true' | |
| run: make lint | |
| - name: Skip lint | |
| if: steps.changes.outputs.run != 'true' | |
| run: echo "Skipping lint for non-code changes." | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| - name: Detect code changes | |
| id: changes | |
| run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}" | |
| - name: Setup uv | |
| if: steps.changes.outputs.run == 'true' | |
| uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| if: steps.changes.outputs.run == 'true' | |
| run: make sync | |
| - name: Run typecheck | |
| if: steps.changes.outputs.run == 'true' | |
| run: make mypy | |
| - name: Skip typecheck | |
| if: steps.changes.outputs.run != 'true' | |
| run: echo "Skipping typecheck for non-code changes." | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| env: | |
| OPENAI_API_KEY: fake-for-tests | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| - name: Detect code changes | |
| id: changes | |
| run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}" | |
| - name: Setup uv | |
| if: steps.changes.outputs.run == 'true' | |
| uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| if: steps.changes.outputs.run == 'true' | |
| run: make sync | |
| - name: Run tests with coverage | |
| if: steps.changes.outputs.run == 'true' | |
| run: make coverage | |
| - name: Skip tests | |
| if: steps.changes.outputs.run != 'true' | |
| run: echo "Skipping tests for non-code changes." | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| env: | |
| OPENAI_API_KEY: fake-for-tests | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| - name: Detect docs changes | |
| id: changes | |
| run: ./.github/scripts/detect-changes.sh docs "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}" | |
| - name: Setup uv | |
| if: steps.changes.outputs.run == 'true' | |
| uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| if: steps.changes.outputs.run == 'true' | |
| run: make sync | |
| - name: Build docs | |
| if: steps.changes.outputs.run == 'true' | |
| run: make build-docs | |
| - name: Skip docs build | |
| if: steps.changes.outputs.run != 'true' | |
| run: echo "Skipping docs build for non-docs changes." | |
| old_version_tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| OPENAI_API_KEY: fake-for-tests | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| - name: Detect code changes | |
| id: changes | |
| run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}" | |
| - name: Setup uv | |
| if: steps.changes.outputs.run == 'true' | |
| uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| if: steps.changes.outputs.run == 'true' | |
| run: make sync | |
| - name: Run tests | |
| if: steps.changes.outputs.run == 'true' | |
| run: make old_version_tests | |
| - name: Skip old version tests | |
| if: steps.changes.outputs.run != 'true' | |
| run: echo "Skipping old version tests for non-code changes." |