Skip to content

Commit 9714c81

Browse files
sundargthbSundar Raghavan
andauthored
ci: add Python version matrix testing to PRs (#329)
* ci: add Python version matrix testing to PRs * fix: all lint and format issues * fix: eof error * test(gateway): mock time.sleep to speed up slow tests --------- Co-authored-by: Sundar Raghavan <[email protected]>
1 parent 120639b commit 9714c81

File tree

44 files changed

+183
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+183
-80
lines changed

.github/workflows/pr-automerge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
3434
// Include ALL required checks
3535
const requiredChecks = [
36-
'Lint',
36+
'Lint and Format',
3737
'Test Python 3.10',
3838
'Test Python 3.11',
3939
'Test Python 3.12',

.github/workflows/test.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
checks: write
12+
pull-requests: write
13+
14+
jobs:
15+
lint:
16+
name: Lint and Format
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v6
23+
with:
24+
python-version: '3.10'
25+
26+
- name: Install uv
27+
run: |
28+
curl -LsSf https://astral.sh/uv/install.sh | sh
29+
echo "$HOME/.local/bin" >> $GITHUB_PATH
30+
31+
- name: Create virtual environment
32+
run: uv venv
33+
34+
- name: Install dependencies
35+
run: uv sync --dev
36+
37+
- name: Run pre-commit
38+
run: uv run pre-commit run --all-files
39+
40+
test:
41+
name: Test Python ${{ matrix.python-version }}
42+
runs-on: ubuntu-latest
43+
strategy:
44+
fail-fast: false # Important: don't stop on first failure
45+
matrix:
46+
python-version: ['3.10', '3.11', '3.12', '3.13']
47+
48+
steps:
49+
- uses: actions/checkout@v5
50+
51+
- name: Set up Python ${{ matrix.python-version }}
52+
uses: actions/setup-python@v6
53+
with:
54+
python-version: ${{ matrix.python-version }}
55+
56+
- name: Install uv
57+
run: |
58+
curl -LsSf https://astral.sh/uv/install.sh | sh
59+
echo "$HOME/.local/bin" >> $GITHUB_PATH
60+
61+
- name: Create virtual environment
62+
run: uv venv
63+
64+
- name: Install dependencies
65+
run: uv sync --dev
66+
67+
- name: Run tests with coverage
68+
run: |
69+
uv run pytest tests/ --cov=src --cov-report=xml --cov-report=term --cov-fail-under=80 \
70+
-k "not test_launch_help_text_updated"
71+
72+
- name: Upload coverage to Codecov
73+
if: matrix.python-version == '3.10'
74+
uses: codecov/codecov-action@v5
75+
with:
76+
file: ./coverage.xml
77+
flags: unittests
78+
name: codecov-umbrella
79+
fail_ci_if_error: false
80+
81+
build:
82+
name: Build Package
83+
runs-on: ubuntu-latest
84+
needs: [lint, test]
85+
steps:
86+
- uses: actions/checkout@v5
87+
88+
- name: Set up Python
89+
uses: actions/setup-python@v6
90+
with:
91+
python-version: '3.10'
92+
93+
- name: Install uv
94+
run: |
95+
curl -LsSf https://astral.sh/uv/install.sh | sh
96+
echo "$HOME/.local/bin" >> $GITHUB_PATH
97+
98+
- name: Build package
99+
run: uv build
100+
101+
- name: Check package
102+
run: uv tool run twine check dist/*
103+
104+
- name: Upload artifacts
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: dist
108+
path: dist/
Lines changed: 1 addition & 1 deletion

documentation/docs/examples/infrastructure-as-code/cdk/basic-runtime/basic-cdk-deploy-sample.md

Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion

documentation/docs/examples/infrastructure-as-code/cloudformation/end-to-end-weather-agent/cloudformation-deploy-with-tools-and-memory-template.md

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)