diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index 93bc723cd4304..b3ee95bc32e14 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -141,7 +141,15 @@ jobs: path: .docker key: ${{ matrix.image }}-${{ hashFiles('cpp/**') }} restore-keys: ${{ matrix.image }}- - - name: Setup Python + - name: Setup Python on hosted runner + if: | + matrix.runs-on == 'ubuntu-latest' + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: 3 + - name: Setup Python on self-hosted runner + if: | + contains(matrix.runs-on, 'self-hosted') run: | sudo apt update sudo apt install -y --no-install-recommends python3 python3-dev python3-pip