Skip to content

Commit

Permalink
Simplify test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Aug 19, 2024
1 parent e0abd02 commit 996c2f7
Showing 1 changed file with 4 additions and 51 deletions.
55 changes: 4 additions & 51 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,12 @@ jobs:
"windows-2019",
},
"python-version": {
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13-dev",
},
"click-version": {
"released",
"8.1.x",
"main",
},
"cloup-version": {
"released",
"master",
}
}
# TODO: List of additional variants to include in the matrix.
Expand All @@ -70,34 +62,7 @@ jobs:
exclude: list[dict[str, str]] = []
# List of unstable criterions.
unstable: list[dict[str, str]] = [
# Ignore failing tests on Click development branch, because some top-level classes (BaseCommand,
# MultiCommand and OptionParser) have been removed. See:
# https://github.com/pallets/click/compare/8.1.x...main#diff-768bcdbbdaa3001d4905761c3eed38d5ce6a62b9127df80de90d9ca4e806cacc
{"click-version": "main"},
]
# 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.
for dev_version in (
{"click-version": "8.1.x"},
{"click-version": "main"},
{"cloup-version": "master"},
):
for criterion in (
# Exclude old OSes. Only keeps the latest OSes of each family.
{"os": "ubuntu-20.04"},
{"os": "macos-13"},
{"os": "windows-2019"},
# Exclude Python's dev version.
{"python-version": "3.13-dev"},
# Exclude intermediate Python version. Only test on oldest and newest released Python versions.
{"python-version": "3.9"},
{"python-version": "3.10"},
{"python-version": "3.11"},
):
exclude.append({**dev_version, **criterion})
unstable: list[dict[str, str]] = []
# Build the job matrix.
jobs: list[dict[str, str]] = []
Expand Down Expand Up @@ -138,12 +103,6 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.test_matrix) }}
name: |
[${{ matrix.state }}]
${{ matrix.os }},
Python ${{ 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' }}
Expand All @@ -164,14 +123,8 @@ jobs:
uv --no-progress pip install --all-extras --requirement ./pyproject.toml .
- name: Unittests
run: >
uv --no-progress run
${{ 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
run: |
uv --no-progress run -- pytest
- name: Codecov upload
uses: codecov/[email protected]
Expand Down

0 comments on commit 996c2f7

Please sign in to comment.