CI: firmware builds run on the image's python3, not setup-python
Changelog: - Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca4c8e6206
commit
de9c860081
1 file changed
+10
-15
@@ -11,25 +11,20 @@ runs:
|
||||
~/.platformio/.cache
|
||||
key: ${{ runner.os }}-pio
|
||||
|
||||
# CUSTOM (TeTeHacko): no actions/setup-python (upstream: '3.13'). Its
|
||||
# Python for Ubuntu 26.04, the runner image, is built for x86-64-v3 and
|
||||
# grg-runner (Xeon E5-2630L v2) has only v2: "CPU ISA level is lower than
|
||||
# required" on every run. The image's own python3 runs anywhere and the
|
||||
# build needs no particular 3.x, so the build runs in a venv of it.
|
||||
- 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
|
||||
SUDO="$(command -v sudo || true)"
|
||||
venv="$RUNNER_TEMP/pyenv"
|
||||
if ! python3 -m venv "$venv"; then
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq python3 python3-venv
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq python3 python3-venv
|
||||
python3 -m venv --clear "$venv"
|
||||
fi
|
||||
# The image's python is often newer than the wheels on PyPI (detools
|
||||
@@ -37,8 +32,8 @@ runs:
|
||||
# headers, which the image does not ship.
|
||||
inc="$("$venv/bin/python" -c 'import sysconfig; print(sysconfig.get_paths()["include"])')"
|
||||
if [ ! -e "$inc/Python.h" ]; then
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq python3-dev
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq python3-dev
|
||||
fi
|
||||
echo "$venv/bin" >>"$GITHUB_PATH"
|
||||
"$venv/bin/python" --version
|
||||
|
||||
Reference in new issue
Block a user