| 1 |
name: ci |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
- test-me-* |
| 8 |
pull_request: |
| 9 |
branches: |
| 10 |
- main |
| 11 |
|
| 12 |
concurrency: |
| 13 |
group: ${{ github.workflow }}-${{ github.ref }} |
| 14 |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 15 |
|
| 16 |
defaults: |
| 17 |
run: |
| 18 |
shell: bash |
| 19 |
|
| 20 |
env: |
| 21 |
LANG: en_US.utf-8 |
| 22 |
LC_ALL: en_US.utf-8 |
| 23 |
PYTHONIOENCODING: UTF-8 |
| 24 |
PYTHONWARNDEFAULTENCODING: "1" |
| 25 |
PYTHON_VERSIONS: "" |
| 26 |
|
| 27 |
jobs: |
| 28 |
|
| 29 |
quality: |
| 30 |
strategy: |
| 31 |
matrix: |
| 32 |
os: |
| 33 |
- ubuntu-latest |
| 34 |
- macos-latest |
| 35 |
- windows-latest |
| 36 |
python-version: |
| 37 |
- "3.10" |
| 38 |
- "3.14" |
| 39 |
include: |
| 40 |
- os: ubuntu-latest |
| 41 |
python-version: "3.11" |
| 42 |
- os: ubuntu-latest |
| 43 |
python-version: "3.12" |
| 44 |
- os: ubuntu-latest |
| 45 |
python-version: "3.13" |
| 46 |
|
| 47 |
runs-on: ${{ matrix.os }} |
| 48 |
|
| 49 |
steps: |
| 50 |
- name: Checkout |
| 51 |
uses: actions/checkout@v4 |
| 52 |
with: |
| 53 |
fetch-depth: 0 |
| 54 |
fetch-tags: true |
| 55 |
|
| 56 |
- name: Setup Python |
| 57 |
uses: actions/setup-python@v6 |
| 58 |
with: |
| 59 |
python-version: ${{ matrix.python-version }} |
| 60 |
|
| 61 |
- name: Setup uv |
| 62 |
uses: astral-sh/setup-uv@v5 |
| 63 |
with: |
| 64 |
enable-cache: true |
| 65 |
cache-dependency-glob: pyproject.toml |
| 66 |
|
| 67 |
- name: Install dependencies |
| 68 |
run: make setup |
| 69 |
|
| 70 |
- name: Check if the documentation builds correctly |
| 71 |
run: make check-docs |
| 72 |
|
| 73 |
- name: Check the code quality |
| 74 |
run: make check-quality |
| 75 |
|
| 76 |
- name: Check if the code is correctly typed |
| 77 |
run: make check-types |
| 78 |
|
| 79 |
- name: Check for breaking changes in the API |
| 80 |
run: make check-api |
| 81 |
|
| 82 |
- name: Store objects inventory for tests |
| 83 |
uses: actions/upload-artifact@v4 |
| 84 |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' }} |
| 85 |
with: |
| 86 |
name: objects.inv |
| 87 |
path: site/objects.inv |
| 88 |
|
| 89 |
tests: |
| 90 |
|
| 91 |
needs: |
| 92 |
- quality |
| 93 |
strategy: |
| 94 |
max-parallel: 4 |
| 95 |
matrix: |
| 96 |
os: |
| 97 |
- ubuntu-latest |
| 98 |
- macos-latest |
| 99 |
- windows-latest |
| 100 |
python-version: |
| 101 |
- "3.10" |
| 102 |
- "3.11" |
| 103 |
- "3.12" |
| 104 |
- "3.13" |
| 105 |
- "3.14" |
| 106 |
- "3.15" |
| 107 |
resolution: |
| 108 |
- highest |
| 109 |
- lowest-direct |
| 110 |
exclude: |
| 111 |
- os: macos-latest |
| 112 |
resolution: lowest-direct |
| 113 |
- os: windows-latest |
| 114 |
resolution: lowest-direct |
| 115 |
runs-on: ${{ matrix.os }} |
| 116 |
continue-on-error: true |
| 117 |
|
| 118 |
steps: |
| 119 |
- name: Checkout |
| 120 |
uses: actions/checkout@v4 |
| 121 |
with: |
| 122 |
fetch-depth: 0 |
| 123 |
fetch-tags: true |
| 124 |
|
| 125 |
- name: Setup Python |
| 126 |
uses: actions/setup-python@v6 |
| 127 |
with: |
| 128 |
python-version: ${{ matrix.python-version }} |
| 129 |
allow-prereleases: true |
| 130 |
|
| 131 |
- name: Setup uv |
| 132 |
uses: astral-sh/setup-uv@v5 |
| 133 |
with: |
| 134 |
enable-cache: true |
| 135 |
cache-dependency-glob: pyproject.toml |
| 136 |
cache-suffix: ${{ matrix.resolution }} |
| 137 |
|
| 138 |
- name: Install dependencies |
| 139 |
env: |
| 140 |
UV_RESOLUTION: ${{ matrix.resolution }} |
| 141 |
run: make setup |
| 142 |
|
| 143 |
- name: Download objects inventory |
| 144 |
uses: actions/download-artifact@v4 |
| 145 |
with: |
| 146 |
name: objects.inv |
| 147 |
path: site/ |
| 148 |
|
| 149 |
- name: Run the test suite |
| 150 |
run: make test |