◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
51 changes: 15 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,23 @@ on: [ pull_request, push ]
jobs:
build-test:
name: Build and Test
runs-on: ubuntu-16.04

strategy:
matrix:
python: [3.6,3.7,3.8,3.9]
shutdown_mode: [Normal,Soft]
toolset: [Mono,.NET]
include:
- toolset: .NET
BUILD_OPTS: --xplat
RUN_TESTS: dotnet
EMBED_TESTS_PATH: netcoreapp3.1_publish/
PERF_TESTS_PATH: net461/
- toolset: Mono
BUILD_OPTS: ""
RUN_TESTS: "mono ./packages/NUnit.*/tools/nunit3-console.exe"
EMBED_TESTS_PATH: ""
PERF_TESTS_PATH: ""

env:
BUILD_OPTS: ${{ matrix.BUILD_OPTS }}
RUN_TESTS: ${{ matrix.RUN_TESTS }}
EMBED_TESTS_PATH: ${{ matrix.EMBED_TESTS_PATH }}
PERF_TESTS_PATH: ${{ matrix.PERF_TESTS_PATH }}
PYTHONNET_SHUTDOWN_MODE: ${{ matrix.SHUTDOWN_MODE }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Mono
if: ${{ matrix.toolset == 'Mono' }}
run: |
sudo apt update
sudo apt install mono-devel ca-certificates-mono -y

- name: Install .NET
if: ${{ matrix.toolset == '.NET' }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
Expand All @@ -54,16 +30,19 @@ jobs:

- name: Install dependencies
run: |
pip install --upgrade setuptools # TEMP - due to setuptools 36.2.0 bug
pip install --upgrade -r requirements.txt

- name: Install
run: |
echo $BUILD_OPTS
python setup.py install $BUILD_OPTS

- name: Python Tests
run: pytest

- name: .NET Tests
run: $RUN_TESTS src/embed_tests/bin/$EMBED_TESTS_PATH/Python.EmbeddingTest.dll --labels=All
17 changes: 17 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
37 changes: 6 additions & 31 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,11 @@ platform:

environment:
global:
PYTHONUNBUFFERED: True
PYTHONWARNINGS: 'ignore:::wheel.pep425tags:'
CODECOV_ENV: PYTHON_VERSION, PLATFORM

matrix:
- PYTHON_VERSION: 3.9
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.8
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.7
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.6
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.9
- PYTHON_VERSION: 3.8
- PYTHON_VERSION: 3.7
Expand All @@ -47,35 +39,18 @@ init:
install:
- python -m pip install -U pip
- pip install --upgrade -r requirements.txt --quiet
- pip install pycparser --quiet

# Install OpenCover. Can't put on `packages.config`, not Mono compatible
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages -Verbosity quiet

build_script:
# Create clean `sdist`. Only used for releases
- python setup.py --quiet sdist
# Build `wheel` with coverage of `setup.py`
- coverage run setup.py bdist_wheel %BUILD_OPTS%

test_script:
- pip install --no-index --find-links=.\dist\ pythonnet
- ps: .\ci\appveyor_run_tests.ps1

on_finish:
# Temporary disable multiple upload due to codecov limit of 20 per commit.
# https://docs.codecov.io/blog/week-8-2017
- coverage xml -i
# - codecov --file coverage.xml --flags setup_windows
# - codecov --file py.coverage --flags python_tests
# - codecov --file cs.coverage --flags embedded_tests
- codecov --file py.coverage cs.coverage coverage.xml --flags setup_windows

artifacts:
- path: dist\*
- path: '.\src\runtime\bin\*.nupkg'

notifications:
- provider: Slack
incoming_webhook:
secure: 2S/t6rGHdbwoxehnvn5KgfsHrBFEtwnPD7M5olGErmz70oWFVpqoWd/EvDwh7rKZGdOTjDmpwcukc2xi5VRaGHbBAqFYS3tAdgAMrcaTNWs=
41 changes: 41 additions & 0 deletions clr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Loading
Toggle all file notes Toggle all file annotations