From 97900a4aa4b1d8a9bd0188e014d557bc13aaecd4 Mon Sep 17 00:00:00 2001 From: sujeito-operator Date: Sun, 23 Aug 2026 21:19:29 +0300 Subject: [PATCH] CI: test on all runners when the build logic changes Co-Authored-By: Ivan Pozdeev --- .github/actions/build-python/action.yml | 3 +- .github/workflows/build.yml | 45 +++++++++++++++++++------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/actions/build-python/action.yml b/.github/actions/build-python/action.yml index 253d99bd..fa310e81 100644 --- a/.github/actions/build-python/action.yml +++ b/.github/actions/build-python/action.yml @@ -1,8 +1,7 @@ name: Build a Python version description: > Install python-build's system dependencies for the current runner's OS, build - the requested version from source with `pyenv install`, and check that the - interpreter that comes out is the one that was asked for. + and check the requested version. inputs: python-version: description: A version as accepted by `pyenv install`. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad0f4ee1..3fc2e674 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,20 +8,45 @@ permissions: contents: read jobs: + discover_build_logic_change: + if: github.event_name == 'pull_request' + runs-on: ubuntu-slim + env: + FULL_OS_MATRIX: '[ + "macos-14", + "macos-15", + "macos-15-intel", + "macos-26", + "macos-26-intel", + "ubuntu-22.04", + "ubuntu-22.04-arm", + "ubuntu-24.04", + "ubuntu-24.04-arm" + ]' + outputs: + os: ${{ steps.detect.outputs.os }} + steps: + - uses: actions/checkout@v7 + - run: git fetch origin "$GITHUB_BASE_REF" + - id: detect + shell: bash + run: | + if [[ -n $(git diff --name-only "origin/$GITHUB_BASE_REF" -- \ + plugins/python-build/bin/python-build \ + .github/actions/build-python/action.yml \ + .github/workflows/build.yml) ]] + then + printf "%s\n" "os<> "$GITHUB_OUTPUT" + fi + build: + needs: discover_build_logic_change + # Run when the detection job succeeded *or was skipped* -- but not failed + if: ${{ !cancelled() && !failure() }} strategy: fail-fast: false matrix: - os: - - macos-14 - - macos-15 - - macos-15-intel - - macos-26 - - macos-26-intel - - ubuntu-22.04 - - ubuntu-22.04-arm - - ubuntu-24.04 - - ubuntu-24.04-arm + os: ${{ fromJson(needs.discover_build_logic_change.outputs.os || '["macos-latest","ubuntu-latest"]') }} python-version: - "3.10" - "3.11"