ci: fall back to the image's python3 when setup-python's build cannot run
pub-release / release (push) Successful in 24m45s
pub-release / release (push) Successful in 24m45s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e3200086c4
commit
03d06d5176
1 file changed
+19
@@ -12,10 +12,29 @@ runs:
|
||||
key: ${{ runner.os }}-pio
|
||||
|
||||
- name: Install Python
|
||||
id: python
|
||||
continue-on-error: true
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.13'
|
||||
|
||||
# CUSTOM (TeTeHacko): setup-python's build for the runner OS can need a
|
||||
# newer CPU than the runner host has ("CPU ISA level is lower than
|
||||
# required"); fall back to the image's own python3 in a venv
|
||||
- name: Python fallback
|
||||
if: steps.python.outcome == 'failure'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
venv="$RUNNER_TEMP/pyenv"
|
||||
if ! python3 -m venv "$venv"; then
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq python3 python3-venv
|
||||
python3 -m venv --clear "$venv"
|
||||
fi
|
||||
echo "$venv/bin" >>"$GITHUB_PATH"
|
||||
"$venv/bin/python" --version
|
||||
|
||||
- name: Install PlatformIO
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
Reference in new issue
Block a user