|
56 | 56 | uv sync |
57 | 57 | uv run pytest |
58 | 58 |
|
| 59 | + run-uipath-llama-index-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-llamaindex-python |
| 79 | + uses: actions/checkout@v4 |
| 80 | + with: |
| 81 | + repository: 'UiPath/uipath-llamaindex-python' |
| 82 | + path: 'uipath-llamaindex-python' |
| 83 | + |
| 84 | + - name: Copy wheel file to uipath-llamaindex-python |
| 85 | + run: | |
| 86 | + mkdir -p uipath-llamaindex-python/wheels |
| 87 | + cp uipath-python/dist/*.whl uipath-llamaindex-python/wheels/ |
| 88 | +
|
| 89 | + - name: Update uipath-python version |
| 90 | + shell: bash |
| 91 | + run: | |
| 92 | + cd uipath-llamaindex-python |
| 93 | + WHL=$(ls wheels/*.whl | head -n1) |
| 94 | + WHL_NAME=$(basename "$WHL") |
| 95 | + echo "Using wheel: $WHL_NAME" |
| 96 | + sed -i "s|uipath>=.*|uipath @ file:///app/wheels/$WHL_NAME\",|" pyproject.toml |
| 97 | +
|
| 98 | + if ! grep -q '\[tool.hatch.metadata\]' pyproject.toml; then |
| 99 | + echo -e '\n[tool.hatch.metadata]\nallow-direct-references = true' >> pyproject.toml |
| 100 | + fi |
| 101 | +
|
| 102 | + - name: Print pyproject.toml to debug |
| 103 | + run: | |
| 104 | + cd uipath-llamaindex-python |
| 105 | + cat pyproject.toml |
| 106 | +
|
| 107 | + - name: Discover testcases |
| 108 | + id: discover |
| 109 | + run: | |
| 110 | + cd uipath-llamaindex-python |
| 111 | +
|
| 112 | + # Find all testcase folders (excluding common folders like README, etc.) |
| 113 | + testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort) |
| 114 | +
|
| 115 | + echo "Found testcase directories:" |
| 116 | + echo "$testcase_dirs" |
| 117 | +
|
| 118 | + #Convert to JSON array for matrix |
| 119 | + testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]') |
| 120 | + echo "testcases=$testcases_json" >> $GITHUB_OUTPUT |
| 121 | +
|
| 122 | + - name: Set up Docker Buildx |
| 123 | + uses: docker/setup-buildx-action@v3 |
| 124 | + |
| 125 | + - name: Build Docker image and run integration tests |
| 126 | + env: |
| 127 | + TESTCASES: ${{ steps.discover.outputs.testcases }} |
| 128 | + ALPHA_TEST_CLIENT_ID: ${{ secrets.ALPHA_TEST_CLIENT_ID }} |
| 129 | + ALPHA_TEST_CLIENT_SECRET: ${{ secrets.ALPHA_TEST_CLIENT_SECRET }} |
| 130 | + ALPHA_BASE_URL: ${{ secrets.ALPHA_BASE_URL }} |
| 131 | + run: | |
| 132 | + cd uipath-llamaindex-python |
| 133 | +
|
| 134 | + testcases=$(echo $TESTCASES | jq -c '.') |
| 135 | +
|
| 136 | + for testcase in $(echo "$testcases" | jq -r '.[]'); do |
| 137 | + echo "Running testcase: $testcase" |
59 | 138 |
|
| 139 | + docker build -f testcases/$testcase/Dockerfile \ |
| 140 | + -t $testcase:test \ |
| 141 | + --build-arg CLIENT_ID="$ALPHA_TEST_CLIENT_ID" \ |
| 142 | + --build-arg CLIENT_SECRET="$ALPHA_TEST_CLIENT_SECRET" \ |
| 143 | + --build-arg BASE_URL="$ALPHA_BASE_URL" \ |
| 144 | + . |
| 145 | + done |
0 commit comments