9
9
jobs :
10
10
build-test :
11
11
name :Build and Test
12
- runs-on :${{ matrix.os }}-latest
12
+ runs-on :${{ matrix.os.instance }}
13
13
timeout-minutes :15
14
14
15
15
strategy :
16
16
fail-fast :false
17
17
matrix :
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
25
20
platform :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"]
26
36
27
37
steps :
28
38
-name :Set Environment on macOS
29
39
uses :maxim-lobanov/setup-xamarin@v1
30
- if :${{ matrix.os == 'macos' }}
40
+ if :${{ matrix.os.category == 'macos' }}
31
41
with :
32
42
mono-version :latest
33
43
43
53
uses :actions/setup-python@v2
44
54
with :
45
55
python-version :${{ matrix.python }}
46
- architecture :${{ matrix.platform }}
56
+ architecture :${{ matrix.os. platform }}
47
57
48
58
-name :Install dependencies
49
59
run :|
@@ -55,42 +65,42 @@ jobs:
55
65
pip install -v .
56
66
57
67
-name :Set Python DLL path and PYTHONHOME (non Windows)
58
- if :${{ matrix.os != 'windows' }}
68
+ if :${{ matrix.os.category != 'windows' }}
59
69
run :|
60
70
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
61
71
echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV
62
72
63
73
-name :Set Python DLL path and PYTHONHOME (Windows)
64
- if :${{ matrix.os == 'windows' }}
74
+ if :${{ matrix.os.category == 'windows' }}
65
75
run :|
66
76
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"
67
77
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')"
68
78
69
79
-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/
71
81
env :
72
82
MONO_THREADS_SUSPEND :preemptive # https://github.com/mono/mono/issues/21466
73
83
74
84
-name :Python Tests (Mono)
75
- if :${{ matrix.os != 'windows' }}
85
+ if :${{ matrix.os.category != 'windows' }}
76
86
run :pytest --runtime mono
77
87
78
88
# TODO: Run these tests on Windows x86
79
89
-name :Python Tests (.NET Core)
80
- if :${{ matrix.platform == 'x64' }}
90
+ if :${{ matrix.os. platform == 'x64' }}
81
91
run :pytest --runtime coreclr
82
92
83
93
-name :Python Tests (.NET Framework)
84
- if :${{ matrix.os == 'windows' }}
94
+ if :${{ matrix.os.category == 'windows' }}
85
95
run :pytest --runtime netfx
86
96
87
97
-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/
89
99
90
100
-name :Perf tests
91
- if :${{ (matrix.python == '3.8') && (matrix.platform == 'x64') }}
101
+ if :${{ (matrix.python == '3.8') && (matrix.os. platform == 'x64') }}
92
102
run :|
93
103
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/
95
105
96
106
# TODO: Run mono tests on Windows?