Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan committed Dec 5, 2023
1 parent 7ad75ed commit 7dcc3c9
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 255 deletions.
26 changes: 26 additions & 0 deletions .github/scripts/check_diff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys

ALL_DIRS = {
"libs/core",
"libs/community",
"libs/langchain",
"libs/experimental",
"libs/partners/openai",
}

if __name__ == "__main__":
files = sys.argv[1:]
dirs_to_run = set()

for file in files:
if any(dir_ in file for dir_ in (".github/workflows", ".github/tools", ".github/actions", "libs/core")):
dirs_to_run = ALL_DIRS
break
elif "libs/community" in file:
dirs_to_run.update(("libs/community", "libs/langchain", "libs/experimental"))
elif "libs/partners" in file:
partner_dir = file.split("/")[2]
dirs_to_run.add(f"libs/partners/{partner_dir}")
else:
pass
print(list(dirs_to_run))
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
---
name: libs/langchain CI
name: langchain CI

on:
push:
branches: [master]
pull_request:
paths:
- ".github/actions/poetry_setup/action.yml"
- ".github/tools/**"
- ".github/workflows/_lint.yml"
- ".github/workflows/_test.yml"
- ".github/workflows/_pydantic_compatibility.yml"
- ".github/workflows/langchain_ci.yml"
- "libs/*"
- "libs/langchain/**"
- "libs/core/**"
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
workflow_call:
inputs:
working-directory:
required: true
type: string
description: "From which folder this pipeline executes"


# If another push to the same PR or branch happens while this workflow is still running,
# cancel the earlier run in favor of the next run.
Expand All @@ -29,31 +22,31 @@ concurrency:

env:
POETRY_VERSION: "1.6.1"
WORKDIR: "libs/langchain"
WORKDIR: ${{ inputs.working-directory }}

jobs:
lint:
uses: ./.github/workflows/_lint.yml
with:
working-directory: libs/langchain
working-directory: ${{ inputs.working-directory }}
secrets: inherit

test:
uses: ./.github/workflows/_test.yml
with:
working-directory: libs/langchain
working-directory: ${{ inputs.working-directory }}
secrets: inherit

compile-integration-tests:
uses: ./.github/workflows/_compile_integration_test.yml
with:
working-directory: libs/langchain
working-directory: ${{ inputs.working-directory }}
secrets: inherit

pydantic-compatibility:
uses: ./.github/workflows/_pydantic_compatibility.yml
with:
working-directory: libs/langchain
working-directory: ${{ inputs.working-directory }}
secrets: inherit

extended-tests:
Expand All @@ -68,6 +61,7 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
if: ${{ inputs.working-directory }} == "libs/langchain"
name: Python ${{ matrix.python-version }} extended tests
steps:
- uses: actions/checkout@v4
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/check_diffs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Check library diffs

on:
push:
branches: [master]
pull_request:
paths:
- ".github/actions/**"
- ".github/tools/**"
- ".github/workflows/**"
- "libs/**"
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI

# If another push to the same PR or branch happens while this workflow is still running,
# cancel the earlier run in favor of the next run.
#
# There's no point in testing an outdated version of the code. GitHub only allows
# a limited number of job runners to be active at the same time, so it's better to cancel
# pointless jobs early so that more useful jobs can run sooner.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- id: files
uses: jitterbit/get-changed-files@v1
- run: |
for changed_file in ${{ steps.files.outputs.all }}; do
echo "Do something with this ${changed_file}."
done
- id: set-matrix
run: echo "::set-output name=dirs-to-run::$(python ../scripts/check_diff.py ${{ steps.files.outputs.all }})
outputs:
dirs-to-run: ${{ steps.set-matrix.outputs.dirs-to-run }}
ci:
runs-on: ubuntu-latest
needs: [ build ]
strategy:
matrix:
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-run) }}
steps:
- uses: ./.github/workflows/_all_ci.yml
with:
working-directory: ${{ matrix.working-directory }}
secrets: inherit


47 changes: 0 additions & 47 deletions .github/workflows/langchain_cli_ci.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/langchain_core_ci.yml

This file was deleted.

136 changes: 0 additions & 136 deletions .github/workflows/langchain_experimental_ci.yml

This file was deleted.

0 comments on commit 7dcc3c9

Please sign in to comment.