CI Improvements #1648
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| build-test: | |
| name: Build and Test | |
| runs-on: ${{ matrix.os.instance }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| # Disabled for now, will require some work (#2653) | |
| # The main issue is setup-dotnet stubbornly installing for x64 only | |
| # | |
| # - category: windows | |
| # platform: x86 | |
| # instance: windows-latest | |
| # suffix: -windows-x86-none | |
| - category: windows | |
| platform: x64 | |
| instance: windows-latest | |
| suffix: -windows-x86_64-none | |
| - category: ubuntu | |
| platform: x64 | |
| instance: ubuntu-22.04 | |
| suffix: "" | |
| - category: ubuntu | |
| platform: arm64 | |
| instance: ubuntu-22.04-arm | |
| suffix: "" | |
| - category: macos | |
| platform: x64 | |
| instance: macos-15 | |
| suffix: -macos-x86_64-none | |
| - category: macos | |
| platform: x64 | |
| instance: macos-15 | |
| suffix: -macos-aarch64-none | |
| python: ["3.10", "3.11", "3.12", "3.13"] | |
| env: | |
| NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Install Mono | |
| uses: ./.github/actions/install-mono | |
| with: | |
| arch: ${{ matrix.os.platform }} | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: cpython-${{ matrix.python }}${{ matrix.os.suffix }} | |
| cache-python: true | |
| activate-environment: true | |
| enable-cache: true | |
| - run: dotnet restore | |
| - name: Synchronize the virtual environment | |
| run: uv sync --managed-python | |
| - name: Embedding tests (Mono/.NET Framework) | |
| run: dotnet test --runtime any-${{ matrix.os.platform }} --framework net472 --logger "console;verbosity=detailed" src/embed_tests/ | |
| env: | |
| MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466 | |
| - name: Embedding tests (.NET Core) | |
| run: dotnet test --runtime any-${{ matrix.os.platform }} --framework net8.0 --logger "console;verbosity=detailed" src/embed_tests/ | |
| - name: Python Tests (Mono) | |
| run: pytest --runtime mono | |
| - name: Python Tests (.NET Core) | |
| run: pytest --runtime coreclr | |
| - name: Python Tests (.NET Framework) | |
| if: ${{ matrix.os.category == 'windows' }} | |
| run: pytest --runtime netfx | |
| - name: Python tests run from .NET | |
| # For some reason, it won't find pytest on the Windows + 3.10 | |
| # combination, which hints that it does not handle the venv properly in | |
| # this combination. | |
| if: ${{ matrix.os.category != 'windows' || matrix.python != '3.10' }} | |
| run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/ |