Fix net10 CI: workflows, generic re-registration, conversions #258
Workflow file for this run
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
| name: Main (x64) | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| build-test: | |
| name: Build and Test | |
| # macos-latest is now Apple Silicon (arm64), but this matrix builds/tests x64 | |
| # (dotnet test --runtime any-x64). Pin macOS to the last Intel runner so the | |
| # x64 .NET host is available and setup-python's x64 build is native. | |
| runs-on: ${{ matrix.os == 'macos' && 'macos-13' || format('{0}-latest', matrix.os) }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # TEMP (testing): reduced matrix to windows+ubuntu / py3.11 only. | |
| # Restore the full matrix below before merging. | |
| # os: [windows, ubuntu, macos] | |
| # python: ["3.8", "3.9", "3.10", "3.11"] | |
| os: [windows, ubuntu] | |
| python: ["3.11"] | |
| platform: [x64, x86] | |
| exclude: | |
| - os: ubuntu | |
| platform: x86 | |
| - os: macos | |
| platform: x86 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| architecture: ${{ matrix.platform }} | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade -r requirements.txt | |
| pip install numpy pytz # for tests | |
| - name: Build and Install | |
| run: | | |
| pip install -v . | |
| - name: Set Python DLL path and PYTHONHOME (non Windows) | |
| if: ${{ matrix.os != 'windows' }} | |
| run: | | |
| echo PYTHONNET_PYDLL=$(python -m pythonnet.find_libpython) >> $GITHUB_ENV | |
| echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV | |
| - name: Set Python DLL path and PYTHONHOME (Windows) | |
| if: ${{ matrix.os == 'windows' }} | |
| run: | | |
| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m pythonnet.find_libpython)" | |
| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')" | |
| - name: Embedding tests | |
| run: dotnet test --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/embed_tests/ | |
| # The runtime now targets net10.0 only, so the Mono and .NET Framework | |
| # hosts can no longer load Python.Runtime. Only the .NET (CoreCLR) host is | |
| # exercised from Python. | |
| - name: Python Tests (.NET Core) | |
| if: ${{ matrix.platform == 'x64' }} | |
| run: pytest --runtime netcore tests | |
| - name: Python tests run from .NET | |
| run: dotnet test --runtime any-${{ matrix.platform }} src/python_tests_runner/ |