Skip to content

build: catch2 is installed with using conan instead of FetchContent #880

build: catch2 is installed with using conan instead of FetchContent

build: catch2 is installed with using conan instead of FetchContent #880

Workflow file for this run

on:
push:
workflow_dispatch:
inputs:
save:
description: 'Save Wheels'
required: true
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: Multi-platform Compatibility Test (Tox)
jobs:
build:
runs-on: ${{ matrix.os }}
env:
PIP_EXTRA_INDEX_URL: ${{vars.PIP_EXTRA_INDEX_URL}}
UV_EXTRA_INDEX_URL: ${{vars.PIP_EXTRA_INDEX_URL}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
name: Python ${{ matrix.python-version }} ${{ matrix.os }} build
steps:
- uses: actions/github-script@v6
id: conan-path-script
with:
result-encoding: string
script: |
if ('${{matrix.os}}' === 'windows-latest'){
return 'C:/Users/runneradmin'
}
if ('${{matrix.os}}' === 'ubuntu-latest'){
return '/home/runner'
}
if ('${{matrix.os}}' === 'macos-latest'){
return '/Users/runner'
}
return ''
- uses: actions/github-script@v6
id: tox-env
with:
script: |
const frontend = "${{matrix.frontend}}"
const toxEnv = "py${{matrix.python-version}}".replace('.','')
if(frontend === ""){
return toxEnv
}
return "py${{matrix.python-version}}".replace('.','') + "-${{matrix.frontend}}"
result-encoding: string
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
pip install uv
- name: Cache Conan
id: cache-conan
uses: actions/cache@v3
with:
path: "${{steps.conan-path-script.outputs.result}}/.conan2"
key: ${{ runner.os }}-conan-${{ hashFiles('conanfile.py') }}-${{ hashFiles('conan.lock') }}
- name: Prebuild Conan packages (Windows)
if: |
contains(matrix.os, 'windows') && steps.cache-conan.outputs.cache-hit != 'true'
shell: cmd
env:
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
run: |
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uv run --only-group=conan conan profile detect
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uv run --only-group=conan conan install . --build missing
- name: Prebuild Conan packages
env:
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
if: "!contains(matrix.os, 'windows') && steps.cache-conan.outputs.cache-hit != 'true'"
run: |
uv run --only-group=conan --frozen conan profile detect --exist-ok
uv run --only-group=conan --frozen conan install conanfile.py --build missing -of /tmp/ciwheelbuilder -pr:b=default
- name: Run Tox (Windows)
if: contains(matrix.os, 'windows')
shell: cmd
run: |
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uv run --only-group tox --with tox-uv tox run
env:
TOX_ENV: "${{ steps.tox-env.outputs.result }}"
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
- name: Run Tox
if: "!contains(matrix.os, 'windows')"
run: cc --version && cc -dumpfullversion -dumpversion && uv run --only-group tox --with tox-uv tox run -vvv
env:
TOX_ENV: "${{ steps.tox-env.outputs.result }}"
CONAN_USER_HOME: "${{steps.conan-path-script.outputs.result}}"
# CIBW_SOME_OPTION: value
- uses: actions/upload-artifact@v4
if: ${{ inputs.save }}
with:
name: uiucprescon.imagevalidate-wheels
path: ./wheelhouse/*.whl