ci(langchain): Added auto lint and integration test config (#73)

This PR adds CI workflows for linting and integration tests to the
Langchain SDK.

Linting is failing due to type checking errors in the SDK (to be fixed
separately).
Integration tests are failing and need updates to match the latest SDK
code (also to be fixed separately).
This commit is contained in:
Twisha Bansal
2024-12-06 13:02:55 +05:30
committed by GitHub
parent 3df68f1b69
commit b81df9ece7
4 changed files with 126 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: langchain
on:
pull_request:
paths: # These paths are the inverse of lint.yml
- "sdks/langchain/**/*.md"
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: none
steps:
- run: echo "No tests required."

54
.github/workflows/lint-langchain.yaml vendored Normal file
View File

@@ -0,0 +1,54 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: langchain
on:
pull_request:
paths:
- 'sdks/langchain/**'
- '!sdks/langchain/**/*.md'
# Declare default permissions as read only.
permissions: read-all
jobs:
lint:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout Repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.13"
- name: Install library requirements
run: pip install -r sdks/langchain/requirements.txt
- name: Install test requirements
run: pip install sdks/langchain[test]
- name: Run linters
run: |
black --check .
isort --check .
- name: Run type-check
env:
MYPYPATH: 'sdks/langchain/src'
run: mypy --install-types --non-interactive --explicit-package-bases sdks/langchain