diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52e4bd8..fc00783 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,10 +188,23 @@ jobs: echo "LD_LIBRARY_PATH=$LP:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV ####################### Setup Python ####################### + # detect python version from SOFA binaries instead of hardcoding it. + - name: Detect SOFA python version + id: pyver + shell: bash + run: | + set -euo pipefail + SP="$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages/Sofa" + TAG=$(ls "$SP" | grep -oE '^Helper\.(cpython-|cp)3[0-9]+' | grep -oE '3[0-9]+$' | head -n1) + [[ -n "$TAG" ]] || { echo "::error::Could not detect python ABI tag from $SP"; ls -la "$SP"; exit 1; } + VERSION="3.${TAG:1}" + echo "SOFA was built against python $VERSION" + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: ${{ steps.pyver.outputs.version }} - name: Install dependencies shell: bash @@ -231,6 +244,11 @@ jobs: - name: Run regression shell: bash + env: + # The regression program captures each scene's output with + # subprocess.run(text=True), which decodes with the locale encoding: + # cp1252 on Windows, which chokes on SOFA's UTF-8 logs. + PYTHONUTF8: '1' run: | set -euo pipefail cd "$WORKSPACE_SRC_PATH"