From 3398252ca0f8fb6de13fd1c3621d25d11e9ac476 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Fri, 31 Jan 2025 11:13:04 +0200 Subject: [PATCH] github: Use only Python 3.13 for pull request runs ...speeds up PR cycle time by not running on all the possible Python configurations all the time. --- .github/workflows/python.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index d6e02a69f..eddfd87a4 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -15,19 +15,28 @@ env: PIP_DISABLE_PIP_VERSION_CHECK: "true" jobs: + configure-strategy: + runs-on: ubuntu-latest + outputs: + python-versions: ${{ steps.gen-matrix.outputs.python-versions }} + steps: + - id: gen-matrix + run: | + if [ ${{ github.event_name }} == "pull_request" ]; then + echo "python-versions=[\"3.13\"]" >> $GITHUB_OUTPUT + else + echo "python-versions=[\"3.9\",\"3.10\",\"3.11\",\"3.12\",\"3.13\"]" >> $GITHUB_OUTPUT + fi + test: + needs: configure-strategy strategy: matrix: os: - ubuntu-latest - macos-latest - windows-latest - python-version: - - "3.9" - - "3.10" - - "3.11" - - "3.12" - - "3.13" + python-version: ${{ fromJson(needs.configure-strategy.outputs.python-versions) }} runs-on: ${{ matrix.os }} defaults: