Skip to content

Tox Multi-platform Compatibility Test #1143

Tox Multi-platform Compatibility Test

Tox Multi-platform Compatibility Test #1143

Workflow file for this run

on: [push, pull_request]
name: Tox Multi-platform Compatibility Test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
tox_matrix: ${{ steps.dataStep.outputs.myoutput }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Get tox environments
with:
cache: 'pip'
python-version: '3.13'
- id: dataStep
run: |
python -m pip install tox-uv
echo "myoutput=$(uvx --quiet --with tox-uv tox list -d --no-desc | sed -E 's/(.*py)([0-9])([0-9]+)/\2.\3/' | jq --raw-input . | jq -c --slurp)" >> $GITHUB_OUTPUT
build:
needs: setup
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ${{ fromJson(needs.setup.outputs.tox_matrix) }}
include:
- os: macos-latest
compiler_libcxx: libc++
conan_user_home: "/Users/runner"
- os: ubuntu-latest
compiler_libcxx: libstdc++11
conan_user_home: "/home/runner"
- os: windows-latest
conan_user_home: 'C:/Users/runneradmin'
fail-fast: false
name: Python ${{ matrix.python-version }} ${{ matrix.os }} build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: "install Python dependencies"
run: |
pip install uv
- uses: actions/cache@v3
id: cache
with:
path: "${{ matrix.conan_user_home }}/.conan2"
key: ${{ runner.os }}-${{ hashFiles('**/conanfile.py') }}
- name: Build conan packages on Non-Windows Operating Systems
if: ${{ !contains(matrix.os, 'windows') && steps.cache.outputs.cache-hit != 'true' }}
run: |
uv run --only-group conan conan profile detect --exist-ok
uv run --only-group conan conan install conanfile.py --build missing -of /tmp/ciwheelbuilder -pr:b=default
rm -rf /tmp/ciwheelbuilder
- uses: actions/github-script@v7
id: tox-env
with:
result-encoding: string
script: |
return "py${{matrix.python-version}}".replace('.','')
- name: Run tox
if: contains(matrix.os, 'windows')
shell: cmd
run: |
rmdir /S /Q C:\\Strawberry
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uv run --only-group conan conan profile detect --exist-ok
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uv run --only-group conan conan install conanfile.py --build missing -of %TEMP%/ciwheelbuilder -pr:b=default
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uv run --only-group tox --with tox-uv tox -e ${{ steps.tox-env.outputs.result }}
env:
CONAN_USER_HOME: ${{ matrix.conan_user_home }}
- name: Run tox
if: "!contains(matrix.os, 'windows')"
run: cc --version && cc -dumpfullversion -dumpversion && uv run --only-group tox --with tox-uv tox -e ${{ steps.tox-env.outputs.result }} -vvv
env:
CONAN_COMPILER_LIBCXX: ${{ matrix.compiler_libcxx }}
CONAN_USER_HOME: ${{ matrix.conan_user_home }}