|
| 1 | +--- |
| 2 | +name: CI |
| 3 | + |
| 4 | +"on": |
| 5 | + push: |
| 6 | + pull_request: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +env: |
| 12 | + DEFAULT_PYTHON: "3.14" |
| 13 | + |
| 14 | +jobs: |
| 15 | + lint: |
| 16 | + name: Lint |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + steps: |
| 20 | + - &checkout |
| 21 | + name: Check out the repository |
| 22 | + uses: actions/checkout@v5 |
| 23 | + with: |
| 24 | + fetch-depth: 2 |
| 25 | + |
| 26 | + - &setup-python |
| 27 | + name: Set up Python ${{ env.DEFAULT_PYTHON }} |
| 28 | + |
| 29 | + with: |
| 30 | + python-version: ${{ env.DEFAULT_PYTHON }} |
| 31 | + check-latest: true |
| 32 | + |
| 33 | + - &setup-uv |
| 34 | + name: Install UV |
| 35 | + uses: astral-sh/setup-uv@v7 |
| 36 | + with: |
| 37 | + enable-cache: true |
| 38 | + version-file: "pyproject.toml" |
| 39 | + |
| 40 | + - &install-dependencies |
| 41 | + name: Install dependencies |
| 42 | + run: uv sync --all-extras --frozen |
| 43 | + |
| 44 | + - name: Lint |
| 45 | + run: uv run --with tox-uv tox -e lint |
| 46 | + |
| 47 | + build: |
| 48 | + if: github.repository_owner == 'PyCQA' |
| 49 | + name: Build |
| 50 | + runs-on: ubuntu-latest |
| 51 | + |
| 52 | + steps: |
| 53 | + - *checkout |
| 54 | + - *setup-python |
| 55 | + - *setup-uv |
| 56 | + |
| 57 | + - name: Build package |
| 58 | + run: uv build |
| 59 | + |
| 60 | + test: |
| 61 | + name: Tests |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + matrix: |
| 65 | + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 66 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 67 | + runs-on: ${{ matrix.os }} |
| 68 | + env: |
| 69 | + FORCE_COLOR: 1 |
| 70 | + |
| 71 | + steps: |
| 72 | + - *checkout |
| 73 | + |
| 74 | + - name: Set up Python ${{ matrix.python-version }} |
| 75 | + uses: actions/setup-python@v6 |
| 76 | + with: |
| 77 | + python-version: ${{ matrix.python-version }} |
| 78 | + allow-prereleases: true |
| 79 | + check-latest: true |
| 80 | + |
| 81 | + - *setup-uv |
| 82 | + - *install-dependencies |
| 83 | + |
| 84 | + - name: Run tests |
| 85 | + run: uv run --with tox-uv tox -e py,coverage_report-ci |
| 86 | + |
| 87 | + - name: Report Coverage |
| 88 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == ${{ env.DEFAULT_PYTHON }} |
| 89 | + uses: codecov/codecov-action@v5 |
| 90 | + |
| 91 | + |
| 92 | + integration: |
| 93 | + name: Integration tests |
| 94 | + runs-on: ubuntu-latest |
| 95 | + |
| 96 | + steps: |
| 97 | + - *checkout |
| 98 | + - *setup-python |
| 99 | + - *setup-uv |
| 100 | + - *install-dependencies |
| 101 | + |
| 102 | + - name: Test integration |
| 103 | + run: ./scripts/test_integration.sh |
0 commit comments