mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-18 09:01:03 +00:00
update workflows
This commit is contained in:
parent
272efba5b9
commit
04f2f6c896
11
.github/scripts/check_diff.py
vendored
11
.github/scripts/check_diff.py
vendored
@ -120,7 +120,9 @@ def _get_configs_for_single_dir(job: str, dir_: str) -> List[Dict[str, str]]:
|
|||||||
if job == "test-pydantic":
|
if job == "test-pydantic":
|
||||||
return _get_pydantic_test_configs(dir_)
|
return _get_pydantic_test_configs(dir_)
|
||||||
|
|
||||||
if dir_ == "libs/core":
|
if job == "codspeed":
|
||||||
|
py_versions = ["3.12"] # 3.13 is not yet supported
|
||||||
|
elif dir_ == "libs/core":
|
||||||
py_versions = ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
py_versions = ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||||
# custom logic for specific directories
|
# custom logic for specific directories
|
||||||
elif dir_ == "libs/partners/milvus":
|
elif dir_ == "libs/partners/milvus":
|
||||||
@ -211,6 +213,8 @@ def _get_configs_for_multi_dirs(
|
|||||||
)
|
)
|
||||||
elif job == "extended-tests":
|
elif job == "extended-tests":
|
||||||
dirs = list(dirs_to_run["extended-test"])
|
dirs = list(dirs_to_run["extended-test"])
|
||||||
|
elif job == "codspeed":
|
||||||
|
dirs = list(dirs_to_run["codspeed"])
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown job: {job}")
|
raise ValueError(f"Unknown job: {job}")
|
||||||
|
|
||||||
@ -226,6 +230,7 @@ if __name__ == "__main__":
|
|||||||
"lint": set(),
|
"lint": set(),
|
||||||
"test": set(),
|
"test": set(),
|
||||||
"extended-test": set(),
|
"extended-test": set(),
|
||||||
|
"codspeed": set(),
|
||||||
}
|
}
|
||||||
docs_edited = False
|
docs_edited = False
|
||||||
|
|
||||||
@ -262,6 +267,8 @@ if __name__ == "__main__":
|
|||||||
found = True
|
found = True
|
||||||
if found:
|
if found:
|
||||||
dirs_to_run["extended-test"].add(dir_)
|
dirs_to_run["extended-test"].add(dir_)
|
||||||
|
if file.startswith("libs/core"):
|
||||||
|
dirs_to_run["codspeed"].add(f"libs/core")
|
||||||
elif file.startswith("libs/standard-tests"):
|
elif file.startswith("libs/standard-tests"):
|
||||||
# TODO: update to include all packages that rely on standard-tests (all partner packages)
|
# TODO: update to include all packages that rely on standard-tests (all partner packages)
|
||||||
# note: won't run on external repo partners
|
# note: won't run on external repo partners
|
||||||
@ -287,6 +294,7 @@ if __name__ == "__main__":
|
|||||||
if not filename.startswith(".")
|
if not filename.startswith(".")
|
||||||
] != ["README.md"]:
|
] != ["README.md"]:
|
||||||
dirs_to_run["test"].add(f"libs/partners/{partner_dir}")
|
dirs_to_run["test"].add(f"libs/partners/{partner_dir}")
|
||||||
|
dirs_to_run["codspeed"].add(f"libs/partners/{partner_dir}")
|
||||||
# Skip if the directory was deleted or is just a tombstone readme
|
# Skip if the directory was deleted or is just a tombstone readme
|
||||||
elif file == "libs/packages.yml":
|
elif file == "libs/packages.yml":
|
||||||
continue
|
continue
|
||||||
@ -312,6 +320,7 @@ if __name__ == "__main__":
|
|||||||
"compile-integration-tests",
|
"compile-integration-tests",
|
||||||
"dependencies",
|
"dependencies",
|
||||||
"test-pydantic",
|
"test-pydantic",
|
||||||
|
"codspeed",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
map_job_to_configs["test-doc-imports"] = (
|
map_job_to_configs["test-doc-imports"] = (
|
||||||
|
16
.github/workflows/check_diffs.yml
vendored
16
.github/workflows/check_diffs.yml
vendored
@ -42,6 +42,7 @@ jobs:
|
|||||||
dependencies: ${{ steps.set-matrix.outputs.dependencies }}
|
dependencies: ${{ steps.set-matrix.outputs.dependencies }}
|
||||||
test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }}
|
test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }}
|
||||||
test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }}
|
test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }}
|
||||||
|
codspeed: ${{ steps.set-matrix.outputs.codspeed }}
|
||||||
lint:
|
lint:
|
||||||
name: cd ${{ matrix.job-configs.working-directory }}
|
name: cd ${{ matrix.job-configs.working-directory }}
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
@ -152,6 +153,21 @@ jobs:
|
|||||||
# grep will exit non-zero if the target message isn't found,
|
# grep will exit non-zero if the target message isn't found,
|
||||||
# and `set -e` above will cause the step to fail.
|
# and `set -e` above will cause the step to fail.
|
||||||
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|
||||||
|
|
||||||
|
codspeed:
|
||||||
|
name: cd ${{ matrix.job-configs.working-directory }}
|
||||||
|
needs: [ build ]
|
||||||
|
if: ${{ needs.build.outputs.codspeed != '[]' }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
job-configs: ${{ fromJson(needs.build.outputs.codspeed) }}
|
||||||
|
fail-fast: false
|
||||||
|
uses: ./.github/workflows/codspeed.yml
|
||||||
|
with:
|
||||||
|
working-directory: ${{ matrix.job-configs.working-directory }}
|
||||||
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
ci_success:
|
ci_success:
|
||||||
name: "CI Success"
|
name: "CI Success"
|
||||||
needs: [build, lint, test, compile-integration-tests, extended-tests, test-doc-imports, test-pydantic]
|
needs: [build, lint, test, compile-integration-tests, extended-tests, test-doc-imports, test-pydantic]
|
||||||
|
32
.github/workflows/codspeed.yml
vendored
32
.github/workflows/codspeed.yml
vendored
@ -1,44 +1,48 @@
|
|||||||
name: CodSpeed
|
name: CodSpeed
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
# Re-usable workflow
|
||||||
branches:
|
workflow_call:
|
||||||
- master
|
inputs:
|
||||||
pull_request:
|
working-directory:
|
||||||
paths:
|
required: true
|
||||||
- 'libs/core/**'
|
type: string
|
||||||
# `workflow_dispatch` allows CodSpeed to trigger backtest
|
description: "From which folder this pipeline executes"
|
||||||
# performance analysis in order to generate initial data.
|
python-version:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
description: "Python version to use"
|
||||||
|
|
||||||
|
# Manual run (you will be prompted for the two inputs)
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codspeed:
|
codspeed:
|
||||||
name: Run benchmarks
|
name: Run benchmarks
|
||||||
if: (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run-codspeed-benchmarks')) || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
|
if: contains(github.event.pull_request.labels.*.name, 'run-codspeed-benchmarks') || github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# We have to use 3.12, 3.13 is not yet supported
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
# Using this action is still necessary for CodSpeed to work
|
# Using this action is still necessary for CodSpeed to work
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
- name: install deps
|
- name: install deps
|
||||||
run: uv sync --group test
|
run: uv sync --group test
|
||||||
working-directory: ./libs/core
|
working-directory: ${{ inputs.working-directory }}
|
||||||
|
|
||||||
- name: Run benchmarks
|
- name: Run benchmarks
|
||||||
uses: CodSpeedHQ/action@v3
|
uses: CodSpeedHQ/action@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODSPEED_TOKEN }}
|
token: ${{ secrets.CODSPEED_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
cd libs/core
|
cd ${{ inputs.working-directory }}
|
||||||
uv run --no-sync pytest ./tests/benchmarks --codspeed
|
uv run --no-sync pytest ./tests/benchmarks --codspeed
|
||||||
mode: walltime
|
mode: walltime
|
||||||
|
Loading…
Reference in New Issue
Block a user