Debian Codegraph @

.github/workflows/test.yml

raw
1 name: Tests
2
3 on:
4 push:
5 paths:
6 - ".github/workflows/test.yml"
7 - "sphinxext/**"
8 - "tests/**"
9 pull_request:
10 paths:
11 - ".github/workflows/test.yml"
12 - "sphinxext/**"
13 - "tests/**"
14
15 permissions:
16 contents: read
17
18 concurrency:
19 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20 cancel-in-progress: true
21
22 env:
23 FORCE_COLOR: "1"
24 PYTHONDEVMODE: "1" # -X dev
25 PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding
26 UV_SYSTEM_PYTHON: "1" # make uv do global installs
27
28 jobs:
29 test:
30 runs-on: ${{ matrix.os }}
31 name: ${{ matrix.os }} (Python ${{ matrix.python }}; Sphinx ${{ matrix.sphinx-version }})
32 timeout-minutes: 15
33 strategy:
34 fail-fast: false
35 matrix:
36 os:
37 - "ubuntu-latest"
38 python:
39 - "3.9"
40 - "3.10"
41 - "3.11"
42 - "3.12"
43 - "3.13"
44 - "3.13t"
45 - "3.14"
46 - "3.14t"
47 sphinx-version:
48 - "6"
49 - "7"
50 - "8"
51 exclude:
52 - python: "3.9"
53 sphinx-version: "8"
54 include:
55 - python: "3.13"
56 sphinx-version: "8"
57 os: "windows-latest"
58 - python: "3.13"
59 sphinx-version: "8"
60 os: "macos-latest"
61 - python: "3.14"
62 sphinx-version: "8"
63 os: "windows-latest"
64 - python: "3.14"
65 sphinx-version: "8"
66 os: "macos-latest"
67
68 steps:
69 - uses: actions/checkout@v4
70 with:
71 persist-credentials: false
72 - name: Set up Python ${{ matrix.python }}
73 uses: actions/setup-python@v5
74 with:
75 python-version: ${{ matrix.python }}
76 allow-prereleases: true
77 - name: Check Python version
78 run: python --version --version
79 - name: Export UV_PYTHON
80 run: echo "UV_PYTHON=$(which python)" >> $GITHUB_ENV
81 - name: Install uv
82 uses: astral-sh/setup-uv@v5
83 with:
84 version: latest
85 enable-cache: false
86 - name: Install dependencies
87 run: uv pip install . --group test
88 - name: Install Sphinx ${{ matrix.sphinx-version }}
89 run: uv pip install --upgrade "Sphinx~=${{ matrix.sphinx-version }}.0"
90 - name: Test with pytest
91 run: python -m pytest -vv
92 env:
93 PYTHONWARNINGS: "error,ignore::DeprecationWarning:sphinx.builders.gettext" # treat all warnings as errors
94 - name: Install social-cards extra
95 run: uv pip install .[social-cards]
96 - name: Test with pytest (social-cards)
97 run: python -m pytest -vv
98 env:
99 PYTHONWARNINGS: "error,ignore::EncodingWarning:matplotlib.font_manager,ignore::DeprecationWarning:sphinx.builders.gettext" # treat all warnings as errors