forked from jquast/telnetlib3
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (146 loc) · 4.42 KB
/
ci.yml
File metadata and controls
178 lines (146 loc) · 4.42 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: CI
on:
push:
branches: [master]
tags: ["*"]
pull_request:
branches: [master]
schedule:
# Monthly on the 1st at 4:30 AM UTC
- cron: "30 4 1 * *"
workflow_dispatch:
env:
FORCE_COLOR: "1"
PIP_DISABLE_PIP_VERSION_CHECK: "1"
jobs:
lint:
name: ${{ matrix.label }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
# docformatter on 3.13 (not yet compatible with 3.14)
- python-version: "3.13"
toxenv: docformatter_check
label: docformatter
# All other linting tools on 3.13
- python-version: "3.13"
toxenv: flake8,flake8_tests,isort_check,pydocstyle,pylint,codespell
label: Linting
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install tox
run: python -Im pip install tox
- name: Run linting
run: python -Im tox -e ${{ matrix.toxenv }}
tests:
name: Python ${{ matrix.python-version }} (${{ matrix.os }})${{ matrix.asyncio-debug && ' [asyncio-debug]' || '' }}${{ matrix.optional && ' [OPTIONAL]' || '' }}
continue-on-error: ${{ matrix.optional || false }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
include:
# Python 3.14 pre-release (Linux + Windows)
- os: ubuntu-latest
python-version: "3.14"
- os: windows-latest
python-version: "3.14"
# Python 3.14 with asyncio debug mode
- os: ubuntu-latest
python-version: "3.14"
asyncio-debug: true
# Python 3.15 pre-release (optional)
- os: ubuntu-latest
python-version: "3.15"
optional: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
- name: Prepare tox environment name
shell: bash
run: |
V=${{ matrix.python-version }}
V=py$(echo $V | tr -d .)
echo TOX_ENV=$V >> $GITHUB_ENV
- name: Install tox
run: python -Im pip install tox
- name: Run tests
run: python -Im tox -e ${{ env.TOX_ENV }}
env:
PYTHONASYNCIODEBUG: ${{ matrix.asyncio-debug && '1' || '' }}
- name: Rename coverage data
if: ${{ !matrix.asyncio-debug }}
shell: bash
run: |
if test -f .coverage; then
mv .coverage{,.${{ matrix.os }}.${{ env.TOX_ENV }}}
fi
- name: Upload coverage data
if: ${{ !matrix.asyncio-debug }}
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage.*
include-hidden-files: true
if-no-files-found: ignore
coverage:
name: Combine & check coverage
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage data
run: |
python -Im pip install coverage[toml]
python -Im coverage combine
python -Im coverage html --skip-covered --skip-empty
python -Im coverage xml
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true
docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install tox
run: python -Im pip install tox
- name: Build docs
run: python -Im tox -e docs