-
Notifications
You must be signed in to change notification settings - Fork 83
105 lines (101 loc) · 3.26 KB
/
integration_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Integration Tests CI
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened, labeled, unlabeled]
workflow_dispatch:
inputs:
run-python-tests:
description: "Run Python integration tests"
default: "true"
required: false
run-js-tests:
description: "Run JS integration tests"
default: "true"
required: false
jobs:
changed_files:
runs-on: ubuntu-latest
outputs:
python_changed: ${{ steps.changed-files.outputs.python_any_changed }}
js_changed: ${{ steps.changed-files.outputs.js_any_changed }}
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
python:
- 'python/**'
js:
- 'js/**'
python_integration_test:
name: Python Integration Test
needs: changed_files
if: >
(github.event_name == 'push') ||
(github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'release') ||
needs.changed_files.outputs.python_changed == 'true'
)) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.run-python-tests == 'true')
runs-on: ubuntu-20.04
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"
- name: Install poetry
run: pipx install poetry==1.4.2
- name: Install dependencies
run: |
poetry install --with dev
poetry run pip install -U langchain langchain_anthropic langchain_openai rapidfuzz pandas
- name: Run Python integration tests
uses: ./.github/actions/python-integration-tests
with:
python-version: 3.11
langchain-api-key-beta: ${{ secrets.LANGSMITH_API_KEY_BETA }}
langchain-api-key-prod: ${{ secrets.LANGSMITH_API_KEY_PROD }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
js_integration_test:
name: JS Integration Test
needs: changed_files
if: >
(github.event_name == 'push') ||
(github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'release') ||
needs.changed_files.outputs.js_changed == 'true'
)) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.run-js-tests == 'true')
runs-on: ubuntu-20.04
defaults:
run:
working-directory: js
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "yarn"
cache-dependency-path: "js/yarn.lock"
- name: Install dependencies
run: yarn install --immutable
- name: Run JS integration tests
uses: ./.github/actions/js-integration-tests
with:
node-version: 20.x
langchain-api-key-beta: ${{ secrets.LANGSMITH_API_KEY_BETA }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}