forked from QuantConnect/pythonnet
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 2.82 KB
/
main.yml
File metadata and controls
98 lines (81 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: GitHub Actions
on: [ pull_request, push ]
jobs:
build-test:
name: Build and Test
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
pyver_minor: [6, 7, 8, 9]
platform: [x64]
shutdown_mode: [Normal, Soft]
include:
- os: ubuntu
pyver_minor: 6
dll_suffix: m
- os: ubuntu
pyver_minor: 7
dll_suffix: m
- os: macos
dll_prefix: lib
dll_pyver_major: '3.'
dll_suffix: m
- os: ubuntu
dll_prefix: lib
dll_pyver_major: '3.'
- os: windows
dll_pyver_major: '3'
- os: ubuntu
dll_ext: .so
- os: windows
dll_ext: .dll
- os: macos
dll_ext: .dylib
env:
PYTHONNET_SHUTDOWN_MODE: ${{ matrix.SHUTDOWN_MODE }}
steps:
- name: Set Environment on macOS
uses: maxim-lobanov/setup-xamarin@v1
if: ${{ matrix.os == 'macos' }}
with:
mono-version: latest
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
- name: Set up Python 3.${{ matrix.pyver_minor }}
uses: actions/setup-python@v2
with:
python-version: 3.${{ matrix.pyver_minor }}
architecture: ${{ matrix.platform }}
- name: Install dependencies
run: |
pip install --upgrade -r requirements.txt
- name: Build and Install
run: |
python setup.py configure
pip install -v .
# TODO this should be gone once clr module sets PythonDLL or preloads it
- name: Python Tests
run: pytest
if: ${{ matrix.os != 'macos' }}
env:
PYTHONNET_PYDLL: ${{ matrix.DLL_PREFIX }}python${{matrix.DLL_PYVER_MAJOR}}${{matrix.PYVER_MINOR}}${{matrix.DLL_SUFFIX}}${{matrix.DLL_EXT}}
- name: Python Tests
run: pytest
if: ${{ matrix.os == 'macos' }}
- name: Embedding tests
run: dotnet test --runtime any-${{ matrix.platform }} src/embed_tests/
if: ${{ matrix.os != 'macos' }} # Not working right now, doesn't find libpython
env:
PYTHONNET_PYDLL: ${{ matrix.DLL_PREFIX }}python${{matrix.DLL_PYVER_MAJOR}}${{matrix.PYVER_MINOR}}${{matrix.DLL_SUFFIX}}${{matrix.DLL_EXT}}
- name: Python tests run from .NET
run: dotnet test --runtime any-${{ matrix.platform }} src/python_tests_runner/
if: ${{ matrix.os == 'windows' }} # Not working for others right now
env:
PYTHONNET_PYDLL: ${{ matrix.DLL_PREFIX }}python${{matrix.DLL_PYVER_MAJOR}}${{matrix.PYVER_MINOR}}${{matrix.DLL_SUFFIX}}${{matrix.DLL_EXT}}
# TODO: Run perf tests
# TODO: Run mono tests on Windows?