refactor: move source root to src subdirectory #847
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-2019'){ | |
| 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: Remove Strawberry Perl (Windows only) | |
| if: contains(matrix.os, 'windows') | |
| run: Remove-Item –path C:\\Strawberry –recurse –force | |
| - name: Cache Conan | |
| id: cache-conan | |
| uses: actions/cache@v3 | |
| with: | |
| path: "${{steps.conan-path-script.outputs.result}}/.conan" | |
| key: ${{ runner.os }}-conan-${{ hashFiles('conanfile.py') }} | |
| - 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: | | |
| call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| uv run --only-group=conan conan profile detect | |
| 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 conan profile detect | |
| uv run --only-group=conan conan install . --build missing | |
| - name: Run Tox (Windows) | |
| if: contains(matrix.os, 'windows') | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| 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.ocr-wheels | |
| path: ./wheelhouse/*.whl | |