-
-
Notifications
You must be signed in to change notification settings - Fork 106
131 lines (124 loc) · 4.43 KB
/
Copy pathmain.yml
File metadata and controls
131 lines (124 loc) · 4.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: tox
on:
push:
branches: [master, develop]
pull_request:
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
perf-budget:
name: Performance budget
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r tests/requirements.txt
python -m pip install -e .
- name: Performance budget
run: python -m pytest tests/test_perf_budget.py -v --no-cov
build:
name: tox (${{ matrix.tox-env }})
runs-on: ubuntu-latest
timeout-minutes: 10
# Job-level continue-on-error, not only step-level: a job that hits
# timeout-minutes is cancelled rather than failed, which a step-level
# continue-on-error cannot absorb -- an experimental env (e.g.
# docs-linkcheck waiting on slow external servers) would still mark
# the whole run cancelled.
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.10'
tox-env: py310
- python-version: '3.11'
tox-env: py311
- python-version: '3.12'
tox-env: py312
- python-version: '3.13'
tox-env: py313
- python-version: '3.14'
tox-env: py314
# Python 3.15 is a pre-release and currently unsupported by
# typing_extensions (no released version survives
# `from typing_extensions import *` on 3.15 because
# no_type_check_decorator is still listed in __all__ after its
# removal from typing), which breaks the python_utils import.
# Failures are advisory until upstream catches up.
- python-version: '3.15-dev'
tox-env: py315
experimental: true
- python-version: '3.14'
tox-env: docs
- python-version: '3.14'
tox-env: docs-demos
- python-version: '3.14'
tox-env: docs-linkcheck
experimental: true
- python-version: '3.14'
tox-env: readme
- python-version: '3.14'
tox-env: ruff
- python-version: '3.14'
tox-env: codespell
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Test with tox
# Step-level continue-on-error keeps the job green for
# experimental (pre-release Python) environments while still
# showing the failing step in the logs
continue-on-error: ${{ matrix.experimental || false }}
run: tox -e ${{ matrix.tox-env }}
- name: Export coverage
if: matrix.tox-env == 'py313'
run: .tox/py313/bin/python -m coverage lcov -o coverage.lcov
- name: Upload coverage to Coveralls
if: matrix.tox-env == 'py313' && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/heads/')
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
with:
file: coverage.lcov
format: lcov
fail-on-error: true
windows:
name: tox (windows / py312)
runs-on: windows-latest
timeout-minutes: 10
env:
# Force UTF-8 I/O so unicode-marker tests (e.g. test_unicode) don't
# hit UnicodeEncodeError against the legacy Windows code page under
# pytest's fd-level capture.
PYTHONUTF8: '1'
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Test with tox
# The 100% coverage gate cannot be met on Windows: POSIX-only
# branches never execute there, so run without the coverage gate
# (`--no-cov` posarg). Linux jobs still enforce full coverage.
run: tox -e py312 -- --no-cov