combined -> optimized adjacency #429
Workflow file for this run
This file contains 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: Main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
concurrency: | |
# Cancel CI runs on a branch (other than main) on updates.defaults: | |
# This limits redundant runs, but also ensures we get signal on every | |
# merge to main. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ !contains(github.ref, 'main')}} | |
jobs: | |
quality: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
# TODO: Caching | |
- name: Set up the environment | |
uses: ./.github/actions/setup-python-env | |
id: setup | |
- name: Install Python dependencies | |
run: uv sync --frozen --all-packages --all-extras | |
shell: bash | |
- name: Run `fmt-check` | |
run: uv run poe fmt-check | |
# Runs this as long as setup succeeds. | |
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }} | |
- name: Run `lint-check` | |
run: uv run poe lint-check | |
# Runs this as long as setup succeeds. | |
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }} | |
- name: Run `lock-check` | |
run: uv run poe lock-check | |
# Runs this as long as setup succeeds. | |
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }} | |
- name: Run `dep-check` | |
run: uv run poe dep-check | |
# Runs this as long as setup succeeds. | |
if: ${{ !cancelled() && steps.setup.conclusion == 'success' }} | |
tests-and-type-check: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up the environment | |
uses: ./.github/actions/setup-python-env | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: (non-3.13) Install Python dependencies (including all extras) | |
if: ${{ success() && matrix.python-version != '3.13' }} | |
run: uv sync --frozen --all-packages --all-extras | |
shell: bash | |
- name: (3.13 only) Install Python dependencies (without extras) | |
if: ${{ success() && matrix.python-version == '3.13' }} | |
run: uv sync --frozen --all-packages | |
shell: bash | |
- name: Test graph-retriever | |
run: | |
uv run coverage run -m pytest -vs packages/graph-retriever | |
--junitxml=junit/test-results-gr-${{ matrix.python-version }}.xml | |
- name: (3.10, 3.11) Test langchain-graph-retriever (In-Memory Stores) with extras | |
if: ${{ success() && matrix.python-version == '3.10' || matrix.python-version == '3.11' }} | |
run: uv run pytest -vs --runextras packages/langchain-graph-retriever | |
--junitxml=junit/test-results-lgr-${{ matrix.python-version }}.xml | |
- name: (3.12) Test langchain-graph-retriever (All Stores) with extras | |
if: ${{ success() && matrix.python-version == '3.12' }} | |
id: test | |
run: uv run coverage run -a -m pytest -vs --runextras packages/langchain-graph-retriever --stores=all | |
--junitxml=junit/test-results-lgr-${{ matrix.python-version }}.xml | |
env: | |
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }} | |
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }} | |
ASTRA_DB_KEYSPACE: ci_${{ github.run_id }}_${{ strategy.job-index }}_${{ github.run_attempt }} | |
- name: (3.13) Test langchain-graph-retriever (In-Memory Stores) without extras | |
if: ${{ success() && matrix.python-version == '3.13' }} | |
run: uv run pytest -vs packages/langchain-graph-retriever | |
--junitxml=junit/test-results-lgr-${{ matrix.python-version }}.xml | |
- name: Drop Astra Keyspace | |
# Even though it seems redundant, the `always() &&` is necessary to signal to | |
# GitHub actions that we want this to run even if the job is cancelled. | |
if: ${{ always() && steps.test.conclusion != 'skipped' }} | |
run: | |
uv run scripts/drop-astra-keyspace.py | |
env: | |
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }} | |
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }} | |
ASTRA_DB_KEYSPACE: ci_${{ github.run_id }}_${{ strategy.job-index }}_${{ github.run_attempt }} | |
- name: Report Coverage | |
if: ${{ success() && matrix.python-version == '3.12' }} | |
run: | | |
uvx coveralls | |
uvx coveralls --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run `type-check` | |
run: uv run poe type-check | |
- name: Upload test results | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-results-${{ matrix.python-version }} | |
path: junit/test-results-*.xml | |
# See https://github.com/EnricoMi/publish-unit-test-result-action#support-fork-repositories-and-dependabot-branches to | |
# enable uploading from forks. | |
publish-test-results: | |
name: "Publish test results" | |
needs: tests-and-type-check | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
# only needed unless run with comment_mode: off | |
pull-requests: write | |
# only needed for private repository | |
contents: read | |
# only needed for private repository | |
issues: read | |
if: always() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: pytest-results-* | |
path: artifacts | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: "artifacts/**/*.xml" | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up the environment | |
uses: ./.github/actions/setup-python-env | |
- name: Sync Docs Dependencies | |
run: uv sync --all-packages --group=docs --all-extras | |
- name: Check if documentation can be built | |
run: uv run mkdocs build --strict | |
id: build | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }} | |
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }} | |
docs-deploy: | |
# Deploy docs on push to main. | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to write to the `gh-pages` branch | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up the environment | |
uses: ./.github/actions/setup-python-env | |
- name: Sync Docs Dependencies | |
run: uv sync --all-packages --group=docs --all-extras | |
- name: Deploy Docs to gh-pages | |
run: uv run mkdocs gh-deploy --force | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }} | |
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }} |