1+ name : Integration testing
2+
3+ on :
4+ push :
5+ branches : [ main, develop ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ permissions :
10+ contents : read
11+ pull-requests : write
12+ actions : read
13+
14+ jobs :
15+ discover-testcases :
16+ runs-on : ubuntu-latest
17+ outputs :
18+ testcases : ${{ steps.discover.outputs.testcases }}
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v4
22+
23+ - name : Discover testcases
24+ id : discover
25+ run : |
26+ # Find all testcase folders (excluding common folders like README, etc.)
27+ testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
28+
29+ echo "Found testcase directories:"
30+ echo "$testcase_dirs"
31+
32+ # Convert to JSON array for matrix
33+ testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
34+ echo "testcases=$testcases_json" >> $GITHUB_OUTPUT
35+
36+ integration-tests :
37+ needs : [discover-testcases]
38+ runs-on : ubuntu-latest
39+ container :
40+ image : ghcr.io/astral-sh/uv:python3.12-bookworm
41+ env :
42+ UIPATH_JOB_KEY : " 3a03d5cb-fa21-4021-894d-a8e2eda0afe0"
43+ strategy :
44+ fail-fast : false
45+ matrix :
46+ testcase : ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
47+ environment : [alpha, cloud]
48+
49+ name : " ${{ matrix.testcase }} / ${{ matrix.environment }}"
50+
51+ steps :
52+ - name : Checkout code
53+ uses : actions/checkout@v4
54+
55+ - name : Setup workspace structure
56+ run : |
57+ echo "Setting up workspace structure to match expected paths"
58+ # Create symlink so /app points to the current workspace
59+ sudo ln -sf $GITHUB_WORKSPACE /app
60+ echo "Created symlink: /app -> $GITHUB_WORKSPACE"
61+
62+ - name : Install dependencies
63+ run : |
64+ echo "Installing dependencies at $(date)"
65+ uv sync
66+ echo "Dependencies installed at $(date)"
67+
68+ - name : Run testcase
69+ env :
70+ CLIENT_ID : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || secrets.CLOUD_TEST_CLIENT_ID }}
71+ CLIENT_SECRET : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || secrets.CLOUD_TEST_CLIENT_SECRET }}
72+ BASE_URL : ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || secrets.CLOUD_BASE_URL }}
73+ USE_AZURE_CHAT : ${{ matrix.use_azure_chat }}
74+ working-directory : testcases/${{ matrix.testcase }}
75+ run : |
76+ echo "Running testcase: ${{ matrix.testcase }}"
77+ echo "Environment: ${{ matrix.environment }}"
78+ echo "Working directory: $(pwd)"
79+
80+ # Execute the testcase run script directly
81+ bash run.sh
82+ bash ../common/validate_output.sh
0 commit comments