From 565dd09a0f91d4b4c4fcbec9062a7d61d9bb6508 Mon Sep 17 00:00:00 2001 From: Bnjoroge1 Date: Wed, 18 Nov 2026 02:10:49 -0500 Subject: [PATCH] ci: run a reduced Python matrix on pull requests A pull request currently expands to 36 jobs: 3 operating systems x 6 Python versions x 2 pyopenssl modes. Most changes to httpie/**/*.py cannot be platform-specific, yet every one of them pays for macOS and Windows six times. Pull requests now run Linux with the oldest and newest supported Python (3.7 and 3.12) and both pyopenssl modes: 4 cells. They keep the signals PR CI actually produces (does the oldest interpreter still import it, does the newest one still work, did the OpenSSL path break) at a ninth of the cost. Pushes to master are unchanged: all 36 cells, so a platform-specific regression still surfaces before release. fail-fast: false is untouched. --- .github/workflows/tests.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d98b63ae69..9fc5a8a64f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,15 +23,14 @@ jobs: test: strategy: fail-fast: false + # Pull requests run the two Python versions that catch the two failure + # modes a change here can actually cause (oldest interpreter, newest + # interpreter) on Linux. Pushes to master keep the full cross-platform + # matrix, so a platform-specific regression still surfaces before a + # release. 36 cells -> 4 on PRs, unchanged on master. matrix: - os: [ubuntu-latest, macos-13, windows-latest] - python-version: - - '3.12' - - '3.11' - - '3.10' - - '3.9' - - '3.8' - - '3.7' + os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest","macos-13","windows-latest"]') }} + python-version: ${{ github.event_name == 'pull_request' && fromJSON('["3.7","3.12"]') || fromJSON('["3.12","3.11","3.10","3.9","3.8","3.7"]') }} pyopenssl: [0, 1] runs-on: ${{ matrix.os }} steps: