install python if not installed (ubuntu/self-hosted)

This commit is contained in:
tequ
2025-11-26 01:38:07 +09:00
parent d02af3c891
commit 2e96ae905d
2 changed files with 17 additions and 2 deletions

View File

@@ -18,10 +18,11 @@ runs:
using: 'composite'
steps:
- name: Get commit message and set environment variable
shell: python
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
python3 - << 'PY'
import json
import os
import secrets
@@ -72,3 +73,4 @@ runs:
print(f"✓ XAHAU_GA_COMMIT_MSG set (available to all subsequent steps)")
print("==========================================")
PY

View File

@@ -182,6 +182,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python if not installed
run: |
if ! which python3 > /dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y python3 python-is-python3
fi
if ! which pip3 > /dev/null 2>&1; then
sudo apt-get install -y python3-pip
fi
- name: Get commit message
id: get-commit-message
@@ -194,6 +204,9 @@ jobs:
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt-get install -y ninja-build ${{ matrix.cc }} ${{ matrix.cxx }} ccache
# Install the specific GCC version needed for Clang
@@ -258,7 +271,7 @@ jobs:
fi
# Install Conan 2
pip install --upgrade "conan>=2.0,<3"
pip3 install --upgrade "conan>=2.0,<3"
- name: Check environment
run: |