From fbe7b68779c094341df050437c69f0c95b877d10 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 2 Jan 2025 07:22:11 -0500 Subject: [PATCH] Tune CI matrix adjustments so reports are clearer Since #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 #1955, but nothing 3.13-related is done in this commit. --- .github/workflows/pythonpackage.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b8e6391a1..aff6354f4 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -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: @@ -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/setup-wsl@v4.0.0 with: distribution: Alpine @@ -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'