feat: Support AgentExectuor enqueue of a Task object. #3356
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Run Unit Tests | |
| on: | |
| push: | |
| branches: [main, 1.0-dev] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test with Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'a2aproject/a2a-python' | |
| services: | |
| postgres: | |
| image: postgres:15-alpine | |
| env: | |
| POSTGRES_USER: a2a | |
| POSTGRES_PASSWORD: a2a_password | |
| POSTGRES_DB: a2a_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: a2a_test | |
| MYSQL_USER: a2a | |
| MYSQL_PASSWORD: a2a_password | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h localhost -u root -proot" --health-interval=10s --health-timeout=5s --health-retries=5 | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up test environment variables | |
| run: | | |
| echo "POSTGRES_TEST_DSN=postgresql+asyncpg://a2a:a2a_password@localhost:5432/a2a_test" >> $GITHUB_ENV | |
| echo "MYSQL_TEST_DSN=mysql+aiomysql://a2a:a2a_password@localhost:3306/a2a_test" >> $GITHUB_ENV | |
| - name: Install uv for Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Add uv to PATH | |
| run: | | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| # Coverage comparison for PRs (only on Python 3.14 to avoid duplicate work) | |
| - name: Checkout Base Branch | |
| if: github.event_name == 'pull_request' && matrix.python-version == '3.14' | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| ref: ${{ github.event.pull_request.base.ref || 'main' }} | |
| clean: true | |
| - name: Install dependencies | |
| run: uv sync --locked | |
| - name: Run coverage (Base) | |
| if: github.event_name == 'pull_request' && matrix.python-version == '3.14' | |
| run: | | |
| uv run pytest --cov=a2a --cov-report=json --cov-report=html:coverage | |
| mv coverage.json /tmp/coverage-base.json | |
| - name: Checkout PR Branch (Restore) | |
| if: github.event_name == 'pull_request' && matrix.python-version == '3.14' | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| clean: true | |
| - name: Run coverage (PR) | |
| if: github.event_name == 'pull_request' && matrix.python-version == '3.14' | |
| run: | | |
| uv run pytest --cov=a2a --cov-report=json --cov-report=html:coverage --cov-report=term --cov-fail-under=88 | |
| mv coverage.json coverage-pr.json | |
| cp /tmp/coverage-base.json coverage-base.json | |
| - name: Save Metadata | |
| if: github.event_name == 'pull_request' && matrix.python-version == '3.14' | |
| run: | | |
| echo ${{ github.event.number }} > ./PR_NUMBER | |
| echo ${{ github.event.pull_request.base.ref || 'main' }} > ./BASE_BRANCH | |
| - name: Upload Coverage Artifacts | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 | |
| if: github.event_name == 'pull_request' && matrix.python-version == '3.14' | |
| with: | |
| name: coverage-data | |
| path: | | |
| coverage-base.json | |
| coverage-pr.json | |
| coverage/ | |
| PR_NUMBER | |
| BASE_BRANCH | |
| retention-days: 1 | |
| # Run standard tests (for matrix items that didn't run coverage PR) | |
| - name: Run tests (Standard) | |
| if: matrix.python-version != '3.14' || github.event_name != 'pull_request' | |
| run: uv run pytest --cov=a2a --cov-report term --cov-fail-under=88 | |
| - name: Upload Artifact (base) | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 | |
| if: github.event_name != 'pull_request' && matrix.python-version == '3.14' | |
| with: | |
| name: coverage-report | |
| path: coverage | |
| retention-days: 14 | |
| - name: Show coverage summary in log | |
| run: uv run coverage report |