|
1 | | -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
2 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
3 | | - |
4 | 1 | name: Python Client - CI |
5 | 2 |
|
6 | 3 | on: |
7 | 4 | push: |
8 | | - branches: [ master ] |
| 5 | + branches: [master] |
9 | 6 | pull_request: |
10 | | - branches: [ master ] |
| 7 | + branches: [master] |
11 | 8 |
|
12 | | -jobs: |
13 | | - build: |
| 9 | +permissions: |
| 10 | + contents: read |
14 | 11 |
|
| 12 | +# Opt into Node.js 24 runtime for all JavaScript actions. |
| 13 | +# Remove once actions/checkout, actions/setup-python and codecov-action |
| 14 | +# ship native Node.js 24 releases (currently scheduled for June 2026). |
| 15 | +env: |
| 16 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' |
| 17 | + |
| 18 | +jobs: |
| 19 | + test: |
| 20 | + name: "Test · Python ${{ matrix.python-version }}" |
15 | 21 | runs-on: ubuntu-latest |
| 22 | + |
16 | 23 | strategy: |
| 24 | + fail-fast: false |
17 | 25 | matrix: |
18 | | - python-version: [3.6, 3.7, 3.8] |
| 26 | + python-version: ["3.11", "3.12", "3.13", "3.14"] |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: "Set up Python ${{ matrix.python-version }}" |
| 32 | + uses: actions/setup-python@v5 |
| 33 | + with: |
| 34 | + python-version: ${{ matrix.python-version }} |
| 35 | + cache: pip |
| 36 | + |
| 37 | + - name: Install dependencies |
| 38 | + run: pip install -e ".[dev]" |
| 39 | + |
| 40 | + - name: Type-check (mypy) |
| 41 | + run: mypy |
| 42 | + |
| 43 | + - name: Test with pytest |
| 44 | + run: pytest --cov-report=xml |
| 45 | + |
| 46 | + - name: Upload coverage to Codecov |
| 47 | + if: matrix.python-version == '3.14' |
| 48 | + uses: codecov/codecov-action@v5 |
| 49 | + with: |
| 50 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 51 | + files: coverage.xml |
| 52 | + fail_ci_if_error: false |
| 53 | + |
| 54 | + build: |
| 55 | + name: "Verify build" |
| 56 | + runs-on: ubuntu-latest |
| 57 | + needs: test |
19 | 58 |
|
20 | 59 | steps: |
21 | | - - uses: actions/checkout@v2 |
22 | | - - name: Set up Python ${{ matrix.python-version }} |
23 | | - uses: actions/setup-python@v2 |
24 | | - with: |
25 | | - python-version: ${{ matrix.python-version }} |
26 | | - - name: Install dependencies |
27 | | - run: | |
28 | | - python -m pip install --upgrade pip |
29 | | - pip install flake8 pytest |
30 | | - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
31 | | - - name: Lint with flake8 |
32 | | - run: | |
33 | | - # stop the build if there are Python syntax errors or undefined names |
34 | | - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
35 | | - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
36 | | - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
37 | | - - name: Test with pytest |
38 | | - run: | |
39 | | - pytest |
40 | | - - name: Upload Codecov |
41 | | - run: | |
42 | | - bash <(curl -s https://codecov.io/bash) |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + |
| 62 | + - uses: actions/setup-python@v5 |
| 63 | + with: |
| 64 | + python-version: "3.14" |
| 65 | + cache: pip |
| 66 | + |
| 67 | + - name: Install build tools |
| 68 | + run: pip install build twine |
| 69 | + |
| 70 | + - name: Build distribution |
| 71 | + run: python -m build |
| 72 | + |
| 73 | + - name: Check distribution metadata |
| 74 | + run: twine check dist/* |
0 commit comments