Skip to content

Commit

Permalink
Tune CI matrix adjustments so reports are clearer
Browse files Browse the repository at this point in the history
Since gitpython-developers#1987, test jobs from `pythonpackage.yml` appear in an
unintuitive order, and some show an extra bool matrix variable in
their names while others don't (this corresponds to `experimental`,
which was always set to some value, but was set in different ways).

This fixes that by:

- Listing all tested versions, rather than introducing some in an
  `include` key. (The `include:`-introduced jobs didn't distinguish
  between originally-present matrix variables and those that are
  introduced based on the values of the original ones.)

- Replacing `os` with `os-type`, which has only the first part of
  the value for `runs-on:` (e.g., `ubuntu`), and adding `os-ver`
  to each matrix job, defaulting it to `latest`, but using `22.04`
  for Python 3.7 on Ubuntu.

This should also naturally extend to adding 3.13, with or without
setting `continue-on-error` to temporarily work around the problems
obseved in gitpython-developers#1955, but nothing 3.13-related is done in this commit.
  • Loading branch information
EliahKagan committed Jan 4, 2025
1 parent cc1c643 commit 8a05390
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- experimental: false
- os: ubuntu-22.04
os-type: [ubuntu, macos, windows]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os-type: macos
python-version: "3.7"
experimental: false
- os: windows-latest
include:
- os-ver: latest
- os-type: ubuntu
python-version: "3.7"
experimental: false
os-ver: "22.04"
- experimental: false

fail-fast: false

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os-type }}-${{ matrix.os-ver }}

defaults:
run:
Expand All @@ -43,7 +44,7 @@ jobs:
allow-prereleases: ${{ matrix.experimental }}

- name: Set up WSL (Windows)
if: startsWith(matrix.os, 'windows')
if: matrix.os-type == 'windows'
uses: Vampire/[email protected]
with:
distribution: Alpine
Expand Down Expand Up @@ -80,7 +81,7 @@ jobs:
# For debugging hook tests on native Windows systems that may have WSL.
- name: Show bash.exe candidates (Windows)
if: startsWith(matrix.os, 'windows')
if: matrix.os-type == 'windows'
run: |
set +e
bash.exe -c 'printenv WSL_DISTRO_NAME; uname -a'
Expand Down

0 comments on commit 8a05390

Please sign in to comment.