diff --git a/.github/actions/setup-build-environment/action.yml b/.github/actions/setup-build-environment/action.yml index cba2d2e5..fc640f3d 100644 --- a/.github/actions/setup-build-environment/action.yml +++ b/.github/actions/setup-build-environment/action.yml @@ -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: |