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]
48
+
49
+ name : " ${{ matrix.testcase }} / ${{ matrix.environment }}"
50
+
51
+ steps :
52
+ - name : Checkout code
53
+ uses : actions/checkout@v4
54
+
55
+ - name : Install dependencies
56
+ run : uv sync
57
+
58
+ - name : Run testcase
59
+ env :
60
+ UIPATH_TENANT_ID : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TENANT_ID || secrets.CLOUD_TENANT_ID }}
61
+ UIPATH_FOLDER_KEY : ${{ matrix.environment == 'alpha' && secrets.ALPHA_FOLDER_KEY || secrets.CLOUD_FOLDER_KEY }}
62
+ PAT_TOKEN : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_PAT_TOKEN || secrets.CLOUD_TEST_PAT_TOKEN }}
63
+ CLIENT_ID : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || secrets.CLOUD_TEST_CLIENT_ID }}
64
+ CLIENT_SECRET : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || secrets.CLOUD_TEST_CLIENT_SECRET }}
65
+ BASE_URL : ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || secrets.CLOUD_BASE_URL }}
66
+ working-directory : testcases/${{ matrix.testcase }}
67
+ run : |
68
+ echo "Running testcase: ${{ matrix.testcase }}"
69
+ echo "Environment: ${{ matrix.environment }}"
70
+ echo "Working directory: $(pwd)"
71
+
72
+ # Execute the testcase run script directly
73
+ bash run.sh
0 commit comments