@@ -56,4 +56,124 @@ jobs:
5656 uv sync
5757 uv run pytest
5858
59+ run-uipath-langchain-integration-tests :
60+ runs-on : ubuntu-latest
61+ permissions :
62+ contents : read
63+ steps :
64+
65+ - name : Checkout uipath-python
66+ uses : actions/checkout@v4
67+ with :
68+ path : ' uipath-python'
69+
70+ - name : Setup uv
71+ uses : astral-sh/setup-uv@v5
72+
73+ - name : Build uipath-python package
74+ run : |
75+ cd uipath-python
76+ uv build
77+
78+ - name : Checkout uipath-langchain-python
79+ uses : actions/checkout@v4
80+ with :
81+ repository : ' UiPath/uipath-langchain-python'
82+ path : ' uipath-langchain-python'
83+ token : ${{ secrets.REPO_ACCESS }}
84+
85+ - name : Copy wheel to uipath-langchain
86+ run : |
87+ mkdir -p uipath-langchain-python/wheels
88+ cp uipath-python/dist/*.whl uipath-langchain-python/wheels/
89+
90+ - name : Update uipath-python version
91+ shell : bash
92+ run : |
93+ cd uipath-langchain-python
94+ WHL=$(ls wheels/*.whl | head -n1)
95+ WHL_NAME=$(basename "$WHL")
96+ echo "Using wheel: $WHL_NAME"
97+ sed -i "s|uipath>=.*|uipath @ file://./wheels/$WHL_NAME\",|" pyproject.toml
98+
99+ if ! grep -q '\[tool.hatch.metadata\]' pyproject.toml; then
100+ echo -e '\n[tool.hatch.metadata]\nallow-direct-references = true' >> pyproject.toml
101+ fi
102+
103+ - name : Print pyproject.toml to debug
104+ run : |
105+ cd uipath-langchain-python
106+ cat pyproject.toml
107+
108+ - name : Discover testcases
109+ id : discover
110+ run : |
111+ cd uipath-langchain-python
112+
113+ # Find all testcase folders (excluding common folders like README, etc.)
114+ testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
115+
116+ echo "Found testcase directories:"
117+ echo "$testcase_dirs"
118+
119+ # Convert to JSON array for matrix
120+ testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
121+ echo "testcases=$testcases_json" >> $GITHUB_ENV
122+
123+ - name : Set up Docker Buildx
124+ uses : docker/setup-buildx-action@v3
125+
126+ - name : Build Docker image
127+ run : |
128+ cd uipath-langchain-python
129+ echo "Building Docker image at $(date)"
130+ docker build -f testcases/Dockerfile \
131+ -t uipath-langchain-testbase:latest .
132+ echo "Docker image built at $(date)"
133+
134+ - name : Run integration tests
135+ env :
136+ TESTCASES : ${{ steps.discover.outputs.testcases }}
137+ ALPHA_TEST_CLIENT_ID : ${{ secrets.ALPHA_TEST_CLIENT_ID }}
138+ ALPHA_TEST_CLIENT_SECRET : ${{ secrets.ALPHA_TEST_CLIENT_SECRET }}
139+ ALPHA_BASE_URL : ${{ secrets.ALPHA_BASE_URL }}
140+ CLOUD_TEST_CLIENT_ID : ${{ secrets.CLOUD_TEST_CLIENT_ID }}
141+ CLOUD_TEST_CLIENT_SECRET : ${{ secrets.CLOUD_TEST_CLIENT_SECRET }}
142+ CLOUD_BASE_URL : ${{ secrets.CLOUD_BASE_URL }}
143+ run : |
144+ cd uipath-langchain-python
145+
146+ testcases=$(echo $testcases | jq -c '.')
147+
148+ environments=("alpha" "cloud")
149+ use_azure_chat_options=("true" "false")
150+
151+ for testcase in $(echo "$testcases" | jq -r '.[]'); do
152+ for environment in "${environments[@]}"; do
153+ for use_azure_chat in "${use_azure_chat_options[@]}"; do
154+ echo "Running testcase: $testcase"
155+ echo "Environment: $environment"
156+ echo "LLM: $( [ $use_azure_chat == "true" ] && echo "UiPathAzureChatOpenAI" || echo "UiPathChat" )"
157+ echo "USE_AZURE_CHAT: $use_azure_chat"
158+
159+ if [ "$environment" == "alpha" ]; then
160+ CLIENT_ID=$ALPHA_TEST_CLIENT_ID
161+ CLIENT_SECRET=$ALPHA_TEST_CLIENT_SECRET
162+ BASE_URL=$ALPHA_BASE_URL
163+ else
164+ CLIENT_ID=$CLOUD_TEST_CLIENT_ID
165+ CLIENT_SECRET=$CLOUD_TEST_CLIENT_SECRET
166+ BASE_URL=$CLOUD_BASE_URL
167+ fi
168+
169+ docker run --rm \
170+ -e CLIENT_ID="$CLIENT_ID" \
171+ -e CLIENT_SECRET="$CLIENT_SECRET" \
172+ -e BASE_URL="$BASE_URL" \
173+ -e USE_AZURE_CHAT="$use_azure_chat" \
174+ uipath-langchain-testbase:latest \
175+ bash "/app/testcases/$testcase/run.sh"
176+ done
177+ done
178+ done
59179
0 commit comments