Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c692491

Browse files
authored
Test other Operating Systems than Linux via Github Actions (pythonnet#1310)
* Add macos and windows to build-matrix * Force platform for tests * Set proper build environment for Mono on macOS * Disable embed tests on macOS
1 parent f5c76b0 commit c692491

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,26 @@ on: [ pull_request, push ]
55
jobs:
66
build-test:
77
name: Build and Test
8-
runs-on: ubuntu-latest
8+
runs-on: ${{ matrix.os }}-latest
99

1010
strategy:
1111
fail-fast: false
1212
matrix:
13+
os: [windows, ubuntu, macos]
1314
python: [3.6, 3.7, 3.8, 3.9]
15+
platform: [x64]
1416
shutdown_mode: [Normal, Soft]
1517

1618
env:
1719
PYTHONNET_SHUTDOWN_MODE: ${{ matrix.SHUTDOWN_MODE }}
1820

1921
steps:
22+
- name: Set Environment on macOS
23+
uses: maxim-lobanov/setup-xamarin@v1
24+
if: ${{ matrix.os == 'macos' }}
25+
with:
26+
mono-version: latest
27+
2028
- name: Checkout code
2129
uses: actions/checkout@v2
2230

@@ -27,6 +35,7 @@ jobs:
2735
uses: actions/setup-python@v2
2836
with:
2937
python-version: ${{ matrix.python }}
38+
architecture: ${{ matrix.platform }}
3039

3140
- name: Install dependencies
3241
run: |
@@ -41,8 +50,8 @@ jobs:
4150
run: pytest
4251

4352
- name: Run Embedding tests
44-
run: dotnet test src/embed_tests/
53+
run: dotnet test --runtime any-${{ matrix.platform }} src/embed_tests/
54+
if: ${{ matrix.os != 'macos' }} # Not working right now, doesn't find libpython
4555

4656
# TODO: Run perf tests
47-
# TODO: Run tests on macos and windows as well
48-
# TODO: Run tests on Windows on .NET Framework
57+
# TODO: Run mono tests on Windows?

0 commit comments

Comments
 (0)