-
Notifications
You must be signed in to change notification settings - Fork 23
177 lines (149 loc) · 5.81 KB
/
test-uipath-langchain.yml
File metadata and controls
177 lines (149 loc) · 5.81 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: uipath - Test Langchain
on:
pull_request:
types: [ opened, synchronize, reopened, labeled ]
jobs:
build-wheels:
runs-on: ubuntu-latest
permissions:
contents: read
if: contains(github.event.pull_request.labels.*.name, 'test:uipath-langchain')
steps:
- name: Checkout uipath-python
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build uipath-core package
working-directory: packages/uipath-core
run: uv build
- name: Build uipath-platform package
working-directory: packages/uipath-platform
run: uv build
- name: Build uipath package
working-directory: packages/uipath
run: uv build
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: uipath-wheels
path: packages/*/dist/*.whl
test-uipath-langchain:
needs: [build-wheels]
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.11", "3.12", "3.13" ]
os: [ ubuntu-latest, windows-latest ]
permissions:
contents: read
steps:
- name: Setup uv
uses: astral-sh/setup-uv@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: uipath-wheels
path: wheels
- name: Checkout uipath-langchain-python
uses: actions/checkout@v4
with:
repository: 'UiPath/uipath-langchain-python'
path: 'uipath-langchain-python'
- name: Update uipath packages
shell: bash
working-directory: uipath-langchain-python
run: |
uv add ../wheels/uipath-core/dist/*.whl --dev
uv add ../wheels/uipath-platform/dist/*.whl --dev
uv add ../wheels/uipath/dist/*.whl --dev
- name: Run uipath-langchain tests
working-directory: uipath-langchain-python
run: |
uv sync --all-extras
uv run pytest
discover-testcases:
runs-on: ubuntu-latest
permissions:
contents: read
needs: [test-uipath-langchain]
outputs:
testcases: ${{ steps.discover.outputs.testcases }}
steps:
- name: Checkout uipath-langchain-python
uses: actions/checkout@v4
with:
repository: 'UiPath/uipath-langchain-python'
path: 'uipath-langchain-python'
- name: Discover testcases
id: discover
working-directory: uipath-langchain-python
run: |
# Find all testcase folders (excluding common folders like README, etc.)
testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
echo "Found testcase directories:"
echo "$testcase_dirs"
# Convert to JSON array for matrix
testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
echo "testcases=$testcases_json" >> $GITHUB_OUTPUT
run-uipath-langchain-integration-tests:
runs-on: ubuntu-latest
needs: [build-wheels, discover-testcases]
container:
image: ghcr.io/astral-sh/uv:python3.12-bookworm
env:
UIPATH_JOB_KEY: "3a03d5cb-fa21-4021-894d-a8e2eda0afe0"
UIPATH_TRACING_ENABLED: false
permissions:
contents: read
strategy:
fail-fast: false
matrix:
testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
environment: [alpha, staging] # temporary disable [cloud]
use_azure_chat: [true, false]
name: "${{ matrix.testcase }} / ${{ matrix.environment }} / ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}"
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: uipath-wheels
path: wheels
- name: Checkout uipath-langchain-python
uses: actions/checkout@v4
with:
repository: 'UiPath/uipath-langchain-python'
path: 'uipath-langchain-python'
- name: Update uipath packages
shell: bash
working-directory: uipath-langchain-python
run: |
uv add ../wheels/uipath-core/dist/*.whl
uv add ../wheels/uipath-platform/dist/*.whl
uv add ../wheels/uipath/dist/*.whl
- name: Install dependencies
working-directory: uipath-langchain-python
run: uv sync
- name: Run testcase
env:
CLIENT_ID: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_ID || matrix.environment == 'cloud' && secrets.CLOUD_TEST_CLIENT_ID }}
CLIENT_SECRET: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_SECRET || matrix.environment == 'cloud' && secrets.CLOUD_TEST_CLIENT_SECRET }}
BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || matrix.environment == 'cloud' && secrets.CLOUD_BASE_URL }}
USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}
UV_PYTHON: "3.12"
working-directory: uipath-langchain-python/testcases/${{ matrix.testcase }}
run: |
echo "Running testcase: ${{ matrix.testcase }}"
echo "Environment: ${{ matrix.environment }}"
echo "LLM: ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}"
echo "USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}"
# Execute the testcase run script directly
bash run.sh
bash ../common/validate_output.sh