-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (52 loc) · 2.11 KB
/
integration-tests.yml
File metadata and controls
62 lines (52 loc) · 2.11 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
name: Integration Tests
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/integration-tests.yml'
- 'src/**/*.py'
- 'tests/**/*.py'
- 'pyproject.toml'
push:
branches: [main]
paths:
- '.github/workflows/integration-tests.yml'
- 'src/**/*.py'
- 'tests/**/*.py'
- 'pyproject.toml'
jobs:
integration-tests:
# Skip integration tests for PRs from forks (they don't have access to secrets)
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ${{ contains(github.server_url, 'github.com') && 'ubuntu-latest' || fromJSON('["self-hosted"]') }}
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --dev
- name: Set up integration test environment
run: |
echo "Setting up environment variables for integration tests..."
# Process GitHub secrets (all configuration stored as secrets)
echo '${{ toJSON(secrets) }}' | jq -r 'to_entries[] | select(.key | startswith("CLOUD_SDK_CFG_")) | "\(.key)=\(.value)"' | while read line; do
echo "$line" >> $GITHUB_ENV
var_name=$(echo "$line" | cut -d= -f1)
echo "Set secret: $var_name"
done
# Process GitHub variables (all configuration stored as variables)
echo '${{ toJSON(vars) }}' | jq -r 'to_entries[] | select(.key | startswith("CLOUD_SDK_CFG_")) | "\(.key)=\(.value)"' | while read line; do
echo "$line" >> $GITHUB_ENV
var_name=$(echo "$line" | cut -d= -f1)
echo "Set variable: $var_name"
done
echo "Environment setup complete - automatically configured all CLOUD_SDK_CFG_* environment variables and secrets"
- name: Run integration tests
run: uv run pytest tests/*/integration/ -v --tb=short