Merge pull request #332 from aliyun/codex/fix-a2a-normal-permission-r… #633
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: Test | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main, master] | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| - "scripts/aliyun/**" | |
| - "scripts/a2a/**" | |
| - "skills/iac-code/**" | |
| - "skills/alicloud-ros-agent/**" | |
| - "skill-runtime/**" | |
| - ".github/workflows/test.yml" | |
| pull_request: | |
| branches: [main, master] | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| - "scripts/aliyun/**" | |
| - "scripts/a2a/**" | |
| - "skills/iac-code/**" | |
| - "skills/alicloud-ros-agent/**" | |
| - "skill-runtime/**" | |
| - ".github/workflows/test.yml" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| skill-bridge-compatibility: | |
| name: Skill bridge (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Verify standard-library bridge entry | |
| run: | | |
| python -m py_compile skills/iac-code/scripts/iac_code.py | |
| python skills/iac-code/scripts/iac_code.py --help | |
| python -m py_compile skills/alicloud-ros-agent/scripts/*.py | |
| python skills/alicloud-ros-agent/scripts/ros_agent.py --help | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Run linters | |
| run: make lint | |
| - name: Verify authentic pinned endpoint catalog | |
| run: | | |
| upstream_dir="$(mktemp -d)" | |
| output_dir="$(mktemp -d)" | |
| git -C "$upstream_dir" init | |
| git -C "$upstream_dir" remote add origin https://github.com/aliyun/aliyun-openapi-meta.git | |
| git -C "$upstream_dir" fetch --depth 1 origin 2563691c22229a0b493606e11166b95896707095 | |
| git -C "$upstream_dir" checkout --detach FETCH_HEAD | |
| test "$(git -C "$upstream_dir" rev-parse HEAD)" = "2563691c22229a0b493606e11166b95896707095" | |
| test "$(sha256sum "$upstream_dir/metadatas/products.json" | cut -d ' ' -f 1)" = \ | |
| "e79346fbe87dbacd73c4cb68520f897add17a8e90cadb8fb03e5efa217d04be5" | |
| cmp "$upstream_dir/metadatas/products.json" \ | |
| tests/tools/cloud/aliyun/fixtures/endpoints/aliyun-openapi-meta/metadatas/products.json | |
| uv run python scripts/aliyun/generate_endpoints.py \ | |
| --source "$upstream_dir/metadatas/products.json" \ | |
| --source-commit 2563691c22229a0b493606e11166b95896707095 \ | |
| --products-sha256 e79346fbe87dbacd73c4cb68520f897add17a8e90cadb8fb03e5efa217d04be5 \ | |
| --openmeta-products tests/tools/cloud/aliyun/fixtures/endpoints/openmeta_products.json \ | |
| --output-dir "$output_dir" | |
| cmp "$output_dir/catalog.json" src/iac_code/tools/cloud/aliyun/data/endpoints/catalog.json | |
| cmp "$output_dir/unavailable.json" src/iac_code/tools/cloud/aliyun/data/endpoints/unavailable.json | |
| cmp "$output_dir/generation_report.json" src/iac_code/tools/cloud/aliyun/data/endpoints/generation_report.json | |
| - name: Verify locked OSS async operation catalog | |
| run: | | |
| oss_version="$(uv run python -c 'import importlib.metadata as m; print(m.version("alibabacloud-oss-v2"))')" | |
| oss_wheel_sha256="$(uv run python scripts/aliyun/generate_oss_operations.py wheel-hash --lockfile uv.lock)" | |
| oss_catalog="$(mktemp)" | |
| uv run python scripts/aliyun/generate_oss_operations.py generate \ | |
| --sdk-version "$oss_version" \ | |
| --sdk-wheel-sha256 "$oss_wheel_sha256" \ | |
| --openmeta-fixture tests/tools/cloud/aliyun/fixtures/oss/openmeta_operations.json \ | |
| --output "$oss_catalog" | |
| cmp "$oss_catalog" src/iac_code/tools/cloud/aliyun/data/oss/operation_catalog.json | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Compile translations | |
| run: make translate | |
| - name: Run tests with coverage | |
| run: | | |
| uv run pytest tests/ -v -n auto \ | |
| --cov --cov-report=term-missing \ | |
| --junitxml=testcase.xml | |
| - name: Check coverage threshold | |
| run: uv run coverage report --fail-under=80 | |
| test-windows: | |
| name: Test (Windows, Python 3.10) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| - name: Run A2A app lifecycle tests serially | |
| # These async lifecycle tests can terminate an xdist worker without a | |
| # Python traceback on Windows. Keep the coverage, but run the module in | |
| # the pytest coordinator process so worker loss cannot mask the result. | |
| run: uv run pytest tests/a2a/test_app.py -v --no-header | |
| - name: Run remaining tests | |
| run: uv run pytest tests/ -v --no-header -n auto --ignore=tests/a2a/test_app.py |