-
Notifications
You must be signed in to change notification settings - Fork 11
90 lines (86 loc) · 2.43 KB
/
test.yml
File metadata and controls
90 lines (86 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Run Tests
on: [push, pull_request]
env:
UV_PYTHON_DOWNLOADS: never
PYTEST_ADDOPTS: "--color=yes"
PYTHONWARNINGS: error
PYTHON_VERSION: "3"
SPHINX_PACKAGE: "sphinx"
jobs:
uv:
strategy:
matrix:
include:
# default Python, different OSs
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
# different Python versions
- os: ubuntu-latest
env:
PYTHON_VERSION: "3.9"
- os: ubuntu-latest
env:
PYTHON_VERSION: "3.13"
- os: ubuntu-latest
env:
PYTHON_VERSION: "3.14"
# different Sphinx versions
- os: ubuntu-latest
env:
SPHINX_PACKAGE: "sphinx==6.2.1"
# datetime.utcfromtimestamp is deprecated in Python 3.12 (fixed in Sphinx 7.1)
PYTHON_VERSION: "3.11"
- os: ubuntu-latest
env:
SPHINX_PACKAGE: "sphinx==7.1"
- os: ubuntu-latest
env:
SPHINX_PACKAGE: "sphinx==7.4"
- os: ubuntu-latest
env:
SPHINX_PACKAGE: "sphinx==8.0"
runs-on: ${{ matrix.os }}
env: ${{ matrix.env || fromJSON('{}') }}
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Checkout submodules
run: |
python tests/update_submodules.py
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install package
env:
# markupsafe 3.0.2 causes a warning which is fixed in 3.0.3
PYTHONWARNINGS: default
run: |
uv sync --locked
- name: Run pytest
run: |
uv run --locked --with "$SPHINX_PACKAGE" pytest
# Just to check if it's still compatible with pip.
pip:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v6
- name: Check (pre-installed) Python version
run: |
python --version
- name: Checkout submodules
run: |
python tests/update_submodules.py
- name: Upgrade pip
env:
PYTHONWARNINGS: error,default::DeprecationWarning
run: |
python -m pip install pip --upgrade
- name: Install Python package
run: |
python -m pip install --group dev .
- name: Run pytest
run: |
python -m pytest