8000 Fix CI by using macos-13 explicitly, adjust OS config (#2373) · pythonnet/pythonnet@6a8a97d · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a8a97d

Browse files
authored
Fix CI by using macos-13 explicitly, adjust OS config (#2373)
1 parent 563e369 commit 6a8a97d

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,35 @@ on:
99
jobs:
1010
build-test:
1111
name: Build and Test
12-
runs-on: ${{ matrix.os }}-latest
12+
runs-on: ${{ matrix.os.instance }}
1313
timeout-minutes: 15
1414

1515
strategy:
1616
fail-fast: false
1717
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
2520
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"]
2636

2737
steps:
2838
- name: Set Environment on macOS
2939
uses: maxim-lobanov/setup-xamarin@v1
30-
if: ${{ matrix.os == 'macos' }}
40+
if: ${{ matrix.os.category == 'macos' }}
3141
with:
3242
mono-version: latest
3343

@@ -43,7 +53,7 @@ jobs:
4353
uses: actions/setup-python@v2
4454
with:
4555
python-version: ${{ matrix.python }}
46-
architecture: ${{ matrix.platform }}
56+
architecture: ${{ matrix.os.platform }}
4757

4858
- name: Install dependencies
4959
run: |
@@ -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' }}
5969
run: |
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' }}
6575
run: |
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/
7181
env:
7282
MONO_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' }}
7686
run: 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' }}
8191
run: pytest --runtime coreclr
8292

8393
- name: Python Tests (.NET Framework)
84-
if: ${{ matrix.os == 'windows' }}
94+
if: ${{ matrix.os.category == 'windows' }}
8595
run: 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') }}
92102
run: |
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?

0 commit comments

Comments
 (0)
0