99jobs :
1010build-test :
1111name :Build and Test
12- runs-on :${{ matrix.os }}-latest
12+ runs-on :${{ matrix.os.instance }}
1313timeout-minutes :15
1414
1515strategy :
1616fail-fast :false
1717matrix :
18- os :[windows, ubuntu, macos]
19- python :["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
20- platform :[x64, x86]
21- exclude :
22- -os :ubuntu
23- platform :x86
24- -os :macos
18+ os :
19+ -category :windows
2520platform :x86
21+ instance :windows-latest
22+
23+ -category :windows
24+ platform :x64
25+ instance :windows-latest
26+
27+ -category :ubuntu
28+ platform :x64
29+ instance :ubuntu-latest
30+
31+ -category :macos
32+ platform :x64
33+ instance :macos-13
34+
35+ python :["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
2636
2737steps :
2838 -name :Set Environment on macOS
2939uses :maxim-lobanov/setup-xamarin@v1
30- if :${{ matrix.os == 'macos' }}
40+ if :${{ matrix.os.category == 'macos' }}
3141with :
3242mono-version :latest
3343
4353uses :actions/setup-python@v2
4454with :
4555python-version :${{ matrix.python }}
46- architecture :${{ matrix.platform }}
56+ architecture :${{ matrix.os. platform }}
4757
4858 -name :Install dependencies
4959run :|
@@ -55,42 +65,42 @@ jobs:
5565 pip install -v .
5666
5767 -name :Set Python DLL path and PYTHONHOME (non Windows)
58- if :${{ matrix.os != 'windows' }}
68+ if :${{ matrix.os.category != 'windows' }}
5969run :|
6070 echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
6171 echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV
6272
6373 -name :Set Python DLL path and PYTHONHOME (Windows)
64- if :${{ matrix.os == 'windows' }}
74+ if :${{ matrix.os.category == 'windows' }}
6575run :|
6676 Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"
6777 Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')"
6878
6979 -name :Embedding tests
70- run :dotnet test --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/embed_tests/
80+ run :dotnet test --runtime any-${{ matrix.os. platform }} --logger "console;verbosity=detailed" src/embed_tests/
7181env :
7282MONO_THREADS_SUSPEND :preemptive # https://github.com/mono/mono/issues/21466
7383
7484 -name :Python Tests (Mono)
75- if :${{ matrix.os != 'windows' }}
85+ if :${{ matrix.os.category != 'windows' }}
7686run :pytest --runtime mono
7787
7888# TODO: Run these tests on Windows x86
7989 -name :Python Tests (.NET Core)
80- if :${{ matrix.platform == 'x64' }}
90+ if :${{ matrix.os. platform == 'x64' }}
8191run :pytest --runtime coreclr
8292
8393 -name :Python Tests (.NET Framework)
84- if :${{ matrix.os == 'windows' }}
94+ if :${{ matrix.os.category == 'windows' }}
8595run :pytest --runtime netfx
8696
8797 -name :Python tests run from .NET
88- run :dotnet test --runtime any-${{ matrix.platform }} src/python_tests_runner/
98+ run :dotnet test --runtime any-${{ matrix.os. platform }} src/python_tests_runner/
8999
90100 -name :Perf tests
91- if :${{ (matrix.python == '3.8') && (matrix.platform == 'x64') }}
101+ if :${{ (matrix.python == '3.8') && (matrix.os. platform == 'x64') }}
92102run :|
93103 pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
94- dotnet test --configuration Release --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/perf_tests/
104+ dotnet test --configuration Release --runtime any-${{ matrix.os. platform }} --logger "console;verbosity=detailed" src/perf_tests/
95105
96106# TODO: Run mono tests on Windows?