|
| 1 | +name: CI |
| 2 | +permissions: read-all |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + pull_request: |
| 7 | + push: |
| 8 | + branches: [main] |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +env: |
| 15 | + # Many color libraries just need this to be set to any value, but at least |
| 16 | + # one distinguishes color depth, where "3" -> "256-bit color". |
| 17 | + FORCE_COLOR: 3 |
| 18 | + |
| 19 | +jobs: |
| 20 | + format: |
| 21 | + name: Format |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| 25 | + |
| 26 | + - name: Install uv |
| 27 | + uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb |
| 28 | + |
| 29 | + - name: Install the project |
| 30 | + run: uv sync --locked --group test |
| 31 | + |
| 32 | + - name: Run lefthook hooks |
| 33 | + run: uv run --frozen lefthook run pre-commit |
| 34 | + |
| 35 | + checks: |
| 36 | + name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} |
| 37 | + runs-on: ${{ matrix.runs-on }} |
| 38 | + needs: [format] |
| 39 | + strategy: |
| 40 | + fail-fast: false |
| 41 | + matrix: |
| 42 | + python-version: ["3.11", "3.12", "3.13"] |
| 43 | + runs-on: [ubuntu-latest, macos-latest, windows-latest] |
| 44 | + |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| 47 | + |
| 48 | + - name: Install uv |
| 49 | + uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb |
| 50 | + with: |
| 51 | + python-version: ${{ matrix.python-version }} |
| 52 | + |
| 53 | + - name: Install the project |
| 54 | + run: uv sync --locked --group test |
| 55 | + |
| 56 | + - name: Test package |
| 57 | + run: >- |
| 58 | + uv run --frozen pytest |
| 59 | + --cov --cov-report=xml --cov-report=term --durations=20 |
| 60 | + src docs tests |
| 61 | +
|
| 62 | + - name: Upload coverage report |
| 63 | + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 |
| 64 | + with: |
| 65 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 66 | + |
| 67 | + check_oldest: |
| 68 | + name: Check Oldest Dependencies |
| 69 | + runs-on: ${{ matrix.runs-on }} |
| 70 | + needs: [format] |
| 71 | + strategy: |
| 72 | + fail-fast: false |
| 73 | + matrix: |
| 74 | + python-version: ["3.11"] |
| 75 | + runs-on: [ubuntu-latest] |
| 76 | + |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| 79 | + |
| 80 | + - name: Install uv |
| 81 | + uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb |
| 82 | + with: |
| 83 | + python-version: ${{ matrix.python-version }} |
| 84 | + - name: Install the project |
| 85 | + run: uv sync --locked --group test --resolution lowest-direct |
| 86 | + |
| 87 | + - name: Test package |
| 88 | + run: >- |
| 89 | + uv run --frozen pytest |
| 90 | + --cov --cov-report=xml --cov-report=term --durations=20 |
| 91 | + src docs tests |
| 92 | +
|
| 93 | + - name: Upload coverage report |
| 94 | + uses: codecov/codecov-action@v18283e04ce6e62d37312384ff67231eb8fd56d24 |
| 95 | + with: |
| 96 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments