Skip to content

Commit 9d5eeed

Browse files
authored
Merge pull request #85 from UiPath/chore/cross-repo-tests-action
chore: add cross repo test action
2 parents 7916399 + 961df19 commit 9d5eeed

File tree

4 files changed

+311
-0
lines changed

4 files changed

+311
-0
lines changed

.github/labeler.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
test:uipath-langchain:
2+
- changed-files:
3+
- any-glob-to-any-file: ['src/**/*.py']
4+
5+
test:uipath:
6+
- changed-files:
7+
- any-glob-to-any-file: ['src/**/*.py']

.github/workflows/auto-label.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Auto Label PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
label:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Label PR
16+
uses: actions/labeler@v5
17+
with:
18+
configuration-path: '.github/labeler.yml'
19+
sync-labels: true
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Test UiPath Langchain
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize, reopened, labeled ]
6+
7+
jobs:
8+
test-uipath-langchain:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: [ "3.11", "3.12", "3.13" ]
13+
os: [ ubuntu-latest, windows-latest ]
14+
15+
permissions:
16+
contents: read
17+
18+
# Only run if PR has the test:uipath-langchain label
19+
if: contains(github.event.pull_request.labels.*.name, 'test:uipath-langchain')
20+
21+
steps:
22+
- name: Checkout uipath-runtime-python
23+
uses: actions/checkout@v4
24+
with:
25+
path: 'uipath-runtime-python'
26+
27+
- name: Setup uv
28+
uses: astral-sh/setup-uv@v5
29+
30+
- name: Setup Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Build uipath-runtime package
36+
working-directory: uipath-runtime-python
37+
run: uv build
38+
39+
- name: Checkout uipath-langchain-python
40+
uses: actions/checkout@v4
41+
with:
42+
repository: 'UiPath/uipath-langchain-python'
43+
path: 'uipath-langchain-python'
44+
45+
- name: Update uipath-runtime version
46+
shell: bash
47+
working-directory: uipath-langchain-python
48+
run: uv add ../uipath-runtime-python/dist/*.whl --dev
49+
50+
- name: Run uipath-langchain tests
51+
working-directory: uipath-langchain-python
52+
run: |
53+
uv sync --all-extras
54+
uv run pytest
55+
56+
discover-testcases:
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: read
60+
needs: [test-uipath-langchain]
61+
outputs:
62+
testcases: ${{ steps.discover.outputs.testcases }}
63+
steps:
64+
- name: Checkout uipath-langchain-python
65+
uses: actions/checkout@v4
66+
with:
67+
repository: 'UiPath/uipath-langchain-python'
68+
path: 'uipath-langchain-python'
69+
70+
- name: Discover testcases
71+
id: discover
72+
working-directory: uipath-langchain-python
73+
run: |
74+
# Find all testcase folders (excluding common folders like README, etc.)
75+
testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
76+
77+
echo "Found testcase directories:"
78+
echo "$testcase_dirs"
79+
80+
# Convert to JSON array for matrix
81+
testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
82+
echo "testcases=$testcases_json" >> $GITHUB_OUTPUT
83+
84+
run-uipath-langchain-integration-tests:
85+
runs-on: ubuntu-latest
86+
needs: [discover-testcases]
87+
container:
88+
image: ghcr.io/astral-sh/uv:python3.12-bookworm
89+
env:
90+
UIPATH_JOB_KEY: "3a03d5cb-fa21-4021-894d-a8e2eda0afe0"
91+
permissions:
92+
contents: read
93+
strategy:
94+
fail-fast: false
95+
matrix:
96+
testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
97+
environment: [alpha, staging] # temporary disable [cloud]
98+
use_azure_chat: [true, false]
99+
100+
name: "${{ matrix.testcase }} / ${{ matrix.environment }} / ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}"
101+
102+
steps:
103+
- name: Checkout uipath-runtime-python
104+
uses: actions/checkout@v4
105+
with:
106+
path: 'uipath-runtime-python'
107+
108+
- name: Build uipath-runtime package
109+
working-directory: uipath-runtime-python
110+
run: uv build
111+
112+
- name: Checkout uipath-langchain-python
113+
uses: actions/checkout@v4
114+
with:
115+
repository: 'UiPath/uipath-langchain-python'
116+
path: 'uipath-langchain-python'
117+
118+
- name: Update uipath-runtime version
119+
shell: bash
120+
working-directory: uipath-langchain-python
121+
run: uv add ../uipath-runtime-python/dist/*.whl --dev
122+
123+
- name: Install dependencies
124+
working-directory: uipath-langchain-python
125+
run: uv sync
126+
127+
- name: Run testcase
128+
env:
129+
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 }}
130+
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 }}
131+
BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || matrix.environment == 'cloud' && secrets.CLOUD_BASE_URL }}
132+
USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}
133+
UV_PYTHON: "3.12"
134+
working-directory: uipath-langchain-python/testcases/${{ matrix.testcase }}
135+
run: |
136+
echo "Running testcase: ${{ matrix.testcase }}"
137+
echo "Environment: ${{ matrix.environment }}"
138+
echo "LLM: ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}"
139+
echo "USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}"
140+
141+
# Execute the testcase run script directly
142+
bash run.sh
143+
bash ../common/validate_output.sh
144+

.github/workflows/test-uipath.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Test UiPath
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize, reopened, labeled ]
6+
7+
jobs:
8+
test-uipath:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: [ "3.11", "3.12", "3.13" ]
13+
os: [ ubuntu-latest, windows-latest ]
14+
15+
permissions:
16+
contents: read
17+
18+
# Only run if PR has the test:uipath label
19+
if: contains(github.event.pull_request.labels.*.name, 'test:uipath')
20+
21+
steps:
22+
- name: Checkout uipath-runtime-python
23+
uses: actions/checkout@v4
24+
with:
25+
path: 'uipath-runtime-python'
26+
27+
- name: Setup uv
28+
uses: astral-sh/setup-uv@v5
29+
30+
- name: Setup Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Build uipath-runtime package
36+
working-directory: uipath-runtime-python
37+
run: uv build
38+
39+
- name: Checkout uipath-python
40+
uses: actions/checkout@v4
41+
with:
42+
repository: 'UiPath/uipath-python'
43+
path: 'uipath-python'
44+
45+
- name: Update uipath-runtime version
46+
shell: bash
47+
working-directory: uipath-python
48+
run: uv add ../uipath-runtime-python/dist/*.whl --dev
49+
50+
- name: Run uipath tests
51+
working-directory: uipath-python
52+
run: |
53+
uv sync --all-extras
54+
uv run pytest
55+
56+
discover-testcases:
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: read
60+
needs: [test-uipath]
61+
outputs:
62+
testcases: ${{ steps.discover.outputs.testcases }}
63+
steps:
64+
- name: Checkout uipath-python
65+
uses: actions/checkout@v4
66+
with:
67+
repository: 'UiPath/uipath-python'
68+
path: 'uipath-python'
69+
70+
- name: Discover testcases
71+
id: discover
72+
working-directory: uipath-python
73+
run: |
74+
# Find all testcase folders (excluding common folders like README, etc.)
75+
testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
76+
77+
echo "Found testcase directories:"
78+
echo "$testcase_dirs"
79+
80+
# Convert to JSON array for matrix
81+
testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
82+
echo "testcases=$testcases_json" >> $GITHUB_OUTPUT
83+
84+
run-uipath-integration-tests:
85+
runs-on: ubuntu-latest
86+
needs: [discover-testcases]
87+
container:
88+
image: ghcr.io/astral-sh/uv:python3.12-bookworm
89+
env:
90+
UIPATH_JOB_KEY: "3a03d5cb-fa21-4021-894d-a8e2eda0afe0"
91+
permissions:
92+
contents: read
93+
strategy:
94+
fail-fast: false
95+
matrix:
96+
testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
97+
environment: [alpha, staging] # temporary disable [cloud]
98+
99+
name: "${{ matrix.testcase }} / ${{ matrix.environment }}"
100+
101+
steps:
102+
- name: Checkout uipath-runtime-python
103+
uses: actions/checkout@v4
104+
with:
105+
path: 'uipath-runtime-python'
106+
107+
- name: Build uipath-runtime package
108+
working-directory: uipath-runtime-python
109+
run: uv build
110+
111+
- name: Checkout uipath-python
112+
uses: actions/checkout@v4
113+
with:
114+
repository: 'UiPath/uipath-python'
115+
path: 'uipath-python'
116+
117+
- name: Update uipath-runtime version
118+
shell: bash
119+
working-directory: uipath-python
120+
run: uv add ../uipath-runtime-python/dist/*.whl --dev
121+
122+
- name: Install dependencies
123+
working-directory: uipath-python
124+
run: uv sync
125+
126+
- name: Run testcase
127+
env:
128+
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 }}
129+
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 }}
130+
BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || matrix.environment == 'cloud' && secrets.CLOUD_BASE_URL }}
131+
USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}
132+
UV_PYTHON: "3.12"
133+
working-directory: uipath-python/testcases/${{ matrix.testcase }}
134+
run: |
135+
echo "Running testcase: ${{ matrix.testcase }}"
136+
echo "Environment: ${{ matrix.environment }}"
137+
138+
# Execute the testcase run script directly
139+
bash run.sh
140+
bash ../common/validate_output.sh
141+

0 commit comments

Comments
 (0)