Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,66 @@ on:
pull_request:
branches: [ main ]

permissions:
contents: read
pull-requests: write
actions: read

jobs:
integration-tests:
discover-testcases:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
outputs:
testcases: ${{ steps.discover.outputs.testcases }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Discover testcases
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
container:
image: ghcr.io/astral-sh/uv:python3.12-bookworm
env:
UIPATH_JOB_KEY: "3a03d5cb-fa21-4021-894d-a8e2eda0afe0"
strategy:
fail-fast: false
matrix:
include:
- build-dir: quickstart-agent
- build-dir: simple-hitl-agent

testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
environment: [alpha, staging] # temporary disable [cloud]

name: "${{ matrix.testcase }} / ${{ matrix.environment }}"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Dependencies
run: uv sync

- name: Build Docker image (${{ matrix.build-dir }})
- 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: testcases/${{ matrix.testcase }}
run: |
docker build -f testcases/${{ matrix.build-dir }}/Dockerfile \
-t ${{ matrix.build-dir }}:test \
--build-arg CLIENT_ID="${{ secrets.ALPHA_TEST_CLIENT_ID }}" \
--build-arg CLIENT_SECRET="${{ secrets.ALPHA_TEST_CLIENT_SECRET }}" \
--build-arg BASE_URL="${{ secrets.ALPHA_BASE_URL }}" \
.
echo "Running testcase: ${{ matrix.testcase }}"
echo "Environment: ${{ matrix.environment }}"
echo "Working directory: $(pwd)"

# Execute the testcase run script directly
bash run.sh
bash ../common/validate_output.sh
Loading