|
1 | | -name: build |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | pull_request: |
6 | 6 | workflow_dispatch: |
7 | 7 |
|
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
8 | 15 | jobs: |
9 | | - build: |
| 16 | + lint: |
| 17 | + name: Lint and format |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v6 |
| 21 | + - name: Set up Python |
| 22 | + uses: actions/setup-python@v6 |
| 23 | + with: |
| 24 | + python-version: "3.14" |
| 25 | + cache: pip |
| 26 | + cache-dependency-path: pyproject.toml |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + python -m pip install -e ".[dev]" |
| 31 | + - name: Run ruff |
| 32 | + run: | |
| 33 | + python -m ruff check . |
| 34 | + python -m ruff format --check . |
| 35 | +
|
| 36 | + test: |
| 37 | + name: Test Python ${{ matrix.python-version }} |
10 | 38 | runs-on: ubuntu-latest |
11 | 39 | strategy: |
12 | 40 | fail-fast: false |
13 | 41 | matrix: |
14 | | - python: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] |
| 42 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v6 |
| 45 | + - name: Set up Python |
| 46 | + uses: actions/setup-python@v6 |
| 47 | + with: |
| 48 | + python-version: ${{ matrix.python-version }} |
| 49 | + cache: pip |
| 50 | + cache-dependency-path: pyproject.toml |
| 51 | + - name: Install package |
| 52 | + run: | |
| 53 | + python -m pip install --upgrade pip |
| 54 | + python -m pip install -e . |
| 55 | + - name: Run tests |
| 56 | + run: make test |
| 57 | + |
| 58 | + package: |
| 59 | + name: Build distribution |
| 60 | + runs-on: ubuntu-latest |
15 | 61 | steps: |
16 | | - - uses: actions/checkout@v4 |
17 | | - - name: Set up Python |
18 | | - uses: actions/setup-python@v5.6.0 |
19 | | - with: |
20 | | - python-version: ${{ matrix.python }} |
21 | | - - name: install dependencies for the minor version |
22 | | - run: | |
23 | | - python -m venv venv |
24 | | - . venv/bin/activate |
25 | | - pip install -r requirements.txt |
26 | | - - name: run tests |
27 | | - run: | |
28 | | - . venv/bin/activate |
29 | | - make test |
30 | | - deactivate |
31 | | - - name: reinstall to the latest version |
32 | | - run: | |
33 | | - python -m venv venv |
34 | | - . venv/bin/activate |
35 | | - pip install --upgrade requests |
36 | | - - name: run tests again |
37 | | - run: | |
38 | | - . venv/bin/activate |
39 | | - make test |
| 62 | + - uses: actions/checkout@v6 |
| 63 | + - name: Set up Python |
| 64 | + uses: actions/setup-python@v6 |
| 65 | + with: |
| 66 | + python-version: "3.14" |
| 67 | + cache: pip |
| 68 | + cache-dependency-path: pyproject.toml |
| 69 | + - name: Install build tools |
| 70 | + run: | |
| 71 | + python -m pip install --upgrade pip |
| 72 | + python -m pip install -e ".[dev]" |
| 73 | + - name: Build and verify package |
| 74 | + run: | |
| 75 | + python -m build |
| 76 | + python -m twine check dist/* |
0 commit comments