Merge pull request #156 from aliyun/feat/sdk #293
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" | |
| pull_request: | |
| branches: [main, master] | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| 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 | |
| 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 tests | |
| run: uv run pytest tests/ -v --no-header |