-
-
Notifications
You must be signed in to change notification settings - Fork 7
142 lines (139 loc) · 5.03 KB
/
tests.yaml
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
---
name: Tests
"on":
push:
branches:
- main
pull_request:
schedule:
# Run tests every Monday at 9:17 to catch regressions.
- cron: "17 9 * * 1"
concurrency:
# Group workflow jobs so new commits cancels in-progress execution triggered by previous commits. Source:
# https://mail.python.org/archives/list/[email protected]/thread/PCBCQMJF64JGRBOX7E2EE4YLKHT4DI55/
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
tests:
strategy:
fail-fast: false
matrix:
# Available OS: https://github.com/actions/runner-images#available-images
os:
- ubuntu-24.04 # x86
- ubuntu-24.04-arm # arm64
- ubuntu-22.04 # x86
- ubuntu-22.04-arm # arm64
- macos-15 # arm64
- macos-13 # x86
- windows-2025 # x86
- windows-2022 # x86
# Available Python: https://github.com/actions/python-versions/blob/main/versions-manifest.json
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
click-version:
- released
- stable
- main
cloup-version:
- released
- master
# Removes from the matrix some combinations for development versions of Click and Cloup. This reduce the size
# of the matrix for tests on non-released versions. While keeping the full exhaustive tests on the released
# versions of Click and Cloup.
exclude:
# Exclude old OSes. Only keeps the latest OSes of each family.
- os: ubuntu-22.04
click-version: stable
- os: ubuntu-22.04
click-version: main
- os: ubuntu-22.04
cloup-version: master
- os: ubuntu-22.04-arm
click-version: stable
- os: ubuntu-22.04-arm
click-version: main
- os: ubuntu-22.04-arm
cloup-version: master
- os: macos-13
click-version: stable
- os: macos-13
click-version: main
- os: macos-13
cloup-version: master
- os: windows-2022
click-version: stable
- os: windows-2022
click-version: main
- os: windows-2022
cloup-version: master
# Exclude old Python version. Only test on latest stable release.
- python-version: "3.10"
click-version: stable
- python-version: "3.10"
click-version: main
- python-version: "3.10"
cloup-version: master
- python-version: "3.11"
click-version: stable
- python-version: "3.11"
click-version: main
- python-version: "3.11"
cloup-version: master
- python-version: "3.12"
click-version: stable
- python-version: "3.12"
click-version: main
- python-version: "3.12"
cloup-version: master
# Exclude Python's dev version.
- python-version: "3.14"
click-version: stable
- python-version: "3.14"
click-version: main
- python-version: "3.14"
cloup-version: master
include:
# Default all jobs as stable, unless marked otherwise below.
- state: stable
name: |
${{ matrix.state == 'stable' && '✅' || '⁉️' }}
${{ matrix.os }},
py${{ matrix.python-version }},
Click ${{ matrix.click-version }},
Cloup ${{ matrix.cloup-version }}
runs-on: ${{ matrix.os }}
# We keep going when a job flagged as not stable fails.
continue-on-error: ${{ matrix.state == 'unstable' }}
steps:
- uses: actions/[email protected]
- name: Install uv
run: |
python -m pip install -r https://raw.githubusercontent.com/kdeldycke/workflows/v4.14.2/requirements/uv.txt
- name: Install project
run: |
uv --no-progress venv --python ${{ matrix.python-version }}
uv --no-progress sync --frozen --extra test --extra pygments --extra sphinx --extra pytest
- name: Unittests
run: >
uv --no-progress run --frozen
${{ matrix.click-version != 'released'
&& format('--with "git+https://github.com/pallets/click.git@{0}"', matrix.click-version) || '' }}
${{ matrix.cloup-version != 'released'
&& format('--with "git+https://github.com/janluke/cloup.git@{0}"', matrix.cloup-version) || ''}}
--
pytest
- name: Codecov - coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Codecov - test results
if: ${{ !cancelled() }}
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}