chore: add llamaindex chat agent sample #591
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration testing | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| paths: | |
| - 'packages/**' | |
| - '.github/workflows/integration_tests.yml' | |
| - '.github/scripts/detect_changed_packages.py' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'packages/**' | |
| - '.github/workflows/integration_tests.yml' | |
| - '.github/scripts/detect_changed_packages.py' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: read | |
| jobs: | |
| detect-changed-packages: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.detect.outputs.packages }} | |
| count: ${{ steps.detect.outputs.count }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Detect changed packages | |
| id: detect | |
| env: | |
| GITHUB_EVENT_NAME: ${{ github.event_name }} | |
| BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} | |
| HEAD_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.event.after }} | |
| run: python .github/scripts/detect_changed_packages.py | |
| discover-testcases: | |
| needs: detect-changed-packages | |
| if: needs.detect-changed-packages.outputs.count > 0 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| testcases: ${{ steps.discover.outputs.testcases }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Discover testcases for changed packages | |
| id: discover | |
| run: | | |
| # Get list of packages to check | |
| PACKAGES='${{ needs.detect-changed-packages.outputs.packages }}' | |
| # Find all testcases in changed packages only | |
| testcases_array="[]" | |
| for package_name in $(echo "$PACKAGES" | jq -r '.[]'); do | |
| testcases_dir="packages/$package_name/testcases" | |
| if [ -d "$testcases_dir" ]; then | |
| echo "Discovering testcases in $package_name" | |
| # Find all testcase folders in this package | |
| for testcase_dir in "$testcases_dir"/*; do | |
| if [ -d "$testcase_dir" ]; then | |
| testcase_name=$(basename "$testcase_dir") | |
| # Skip 'common' directory if it exists | |
| if [ "$testcase_name" != "common" ]; then | |
| echo " Found: $testcase_name" | |
| testcases_array=$(echo "$testcases_array" | jq -c ". += [{\"package\": \"$package_name\", \"testcase\": \"$testcase_name\"}]") | |
| fi | |
| fi | |
| done | |
| fi | |
| done | |
| echo "Testcases matrix: $testcases_array" | |
| echo "testcases=$testcases_array" >> $GITHUB_OUTPUT | |
| integration-tests: | |
| needs: [detect-changed-packages, discover-testcases] | |
| if: needs.discover-testcases.outputs.testcases != '[]' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| container: | |
| image: ghcr.io/astral-sh/uv:python3.12-bookworm | |
| env: | |
| UIPATH_JOB_KEY: "3a03d5cb-fa21-4021-894d-a8e2eda0afe0" | |
| UIPATH_TRACING_ENABLED: false | |
| defaults: | |
| run: | |
| working-directory: packages/${{ matrix.testcase-info.package }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| testcase-info: ${{ fromJson(needs.discover-testcases.outputs.testcases) }} | |
| environment: [alpha, cloud, staging] | |
| name: "${{ matrix.testcase-info.package }}/${{ matrix.testcase-info.testcase }} / ${{ matrix.environment }}" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Dependencies | |
| 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 }} | |
| working-directory: packages/${{ matrix.testcase-info.package }}/testcases/${{ matrix.testcase-info.testcase }} | |
| run: | | |
| echo "Running testcase: ${{ matrix.testcase-info.testcase }}" | |
| echo "Package: ${{ matrix.testcase-info.package }}" | |
| echo "Environment: ${{ matrix.environment }}" | |
| echo "Working directory: $(pwd)" | |
| # Execute the testcase run script directly | |
| bash run.sh | |
| bash ../common/validate_output.sh |