-
Notifications
You must be signed in to change notification settings - Fork 33
74 lines (62 loc) · 2.58 KB
/
integration_tests.yml
File metadata and controls
74 lines (62 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Integration testing
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
permissions:
contents: read
pull-requests: write
actions: read
jobs:
discover-testcases:
runs-on: ubuntu-latest
outputs:
testcases: ${{ steps.discover.outputs.testcases }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Discover testcases
# Skip common directory - it's shared utilities, not a testcase
id: discover
run: |
# Find all testcase folders (excluding common folders like README, etc.)
testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
echo "Found testcase directories:"
echo "$testcase_dirs"
# Convert to JSON array for matrix
testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
echo "testcases=$testcases_json" >> $GITHUB_OUTPUT
integration-tests:
needs: [discover-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
strategy:
fail-fast: false
matrix:
testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
environment: [alpha, cloud, staging]
name: "${{ matrix.testcase }} / ${{ matrix.environment }}"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Dependencies
run: uv sync
- name: Run testcase
env:
ENVIRONMENT: ${{ matrix.environment }}
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: testcases/${{ matrix.testcase }}
run: |
echo "Running testcase: ${{ matrix.testcase }}"
echo "Environment: ${{ matrix.environment }}"
# Execute the testcase run script directly
bash run.sh
bash ../common/validate_output.sh