Skip to content

Commit 27c4ae9

Browse files
committed
ci: add staging support and update integration test workflow
1 parent 3dfdf20 commit 27c4ae9

9 files changed

Lines changed: 945 additions & 96 deletions

File tree

.github/workflows/integration_tests.yml

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,66 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
actions: read
13+
914
jobs:
10-
integration-tests:
15+
discover-testcases:
1116
runs-on: ubuntu-latest
12-
permissions:
13-
contents: read
14-
pull-requests: write
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)
1528
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"
1643
strategy:
44+
fail-fast: false
1745
matrix:
18-
include:
19-
- build-dir: quickstart-agent
20-
- build-dir: simple-hitl-agent
21-
46+
testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
47+
environment: [alpha, staging, cloud]
48+
49+
name: "${{ matrix.testcase }} / ${{ matrix.environment }}"
50+
2251
steps:
2352
- name: Checkout code
2453
uses: actions/checkout@v4
2554

26-
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v3
55+
- name: Install Dependencies
56+
run: uv sync
2857

29-
- name: Build Docker image (${{ matrix.build-dir }})
58+
- name: Run testcase
59+
env:
60+
CLIENT_ID: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_ID || secrets.CLOUD_TEST_CLIENT_ID }}
61+
CLIENT_SECRET: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_SECRET || secrets.CLOUD_TEST_CLIENT_SECRET }}
62+
BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || secrets.CLOUD_BASE_URL }}
63+
working-directory: testcases/${{ matrix.testcase }}
3064
run: |
31-
docker build -f testcases/${{ matrix.build-dir }}/Dockerfile \
32-
-t ${{ matrix.build-dir }}:test \
33-
--build-arg CLIENT_ID="${{ secrets.ALPHA_TEST_CLIENT_ID }}" \
34-
--build-arg CLIENT_SECRET="${{ secrets.ALPHA_TEST_CLIENT_SECRET }}" \
35-
--build-arg BASE_URL="${{ secrets.ALPHA_BASE_URL }}" \
36-
.
65+
echo "Running testcase: ${{ matrix.testcase }}"
66+
echo "Environment: ${{ matrix.environment }}"
67+
echo "Working directory: $(pwd)"
68+
69+
# Execute the testcase run script directly
70+
bash run.sh
71+
bash ../common/validate_output.sh

0 commit comments

Comments
 (0)