Skip to content

Commit

Permalink
GH-44396: [CI][C++] Use setup-python on hosted runner (#44411)
Browse files Browse the repository at this point in the history
### Rationale for this change

We can't install packages by `pip install` with Ubuntu 24.04's pip by default.

### What changes are included in this PR?

Use `actions/setup-python` instead. We can install packages by `pip install` with `actions/setup-python` by default.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #44396

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
  • Loading branch information
kou authored Oct 15, 2024
1 parent 974a46a commit 04ea3d8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04ea3d8

Please sign in to comment.