Skip to content

Commit 0c2bb2c

Browse files
committed
ci: Add GitHub Action to automatically run unit tests
1 parent c6436ee commit 0c2bb2c

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/unit-tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Run Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
name: Test with Python ${{ matrix.python-version }}
14+
15+
runs-on: ubuntu-latest
16+
17+
if: github.repository == 'google/a2a-python'
18+
19+
strategy:
20+
matrix:
21+
python-version: ['3.13']
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
cache: uv
32+
cache-dependency-path: uv.lock
33+
34+
- name: Install uv
35+
run: |
36+
curl -LsSf https://astral.sh/uv/install.sh | sh
37+
38+
- name: Add uv to PATH
39+
run: |
40+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
41+
42+
- name: Install dependencies
43+
run: uv sync --dev
44+
45+
- name: Run tests
46+
run: pytest
47+
48+
- name: Upload coverage report
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: coverage-report-${{ matrix.python-version }}
52+
path: coverage.xml
53+
if-no-files-found: ignore

0 commit comments

Comments
 (0)