Skip to content
Merged
Prev Previous commit
Next Next commit
Adjust workflows
- Build tests explicitly
- Build test fixtures from the pytest call
- Run tests with dotnet test
- Reset solution file
- Always run full test matrix

Note: Newer .NET runs Mono tests as well as .NET Core tests if both
target frameworks are defined.
  • Loading branch information
filmor committed Dec 9, 2020
commit ee990b7d35a8c03f016bf2ca36b355654db31baa
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
runs-on: ubuntu-latest

strategy:
fail-fast: false
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: ""

python: [3.6, 3.7, 3.8, 3.9]
shutdown_mode: [Normal, Soft]

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' }}
- name: Setup .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
- name: Build and Install
run: |
echo $BUILD_OPTS
python setup.py install $BUILD_OPTS
python setup.py configure
pip install -v .

- name: Python Tests
run: pytest

- name: .NET Tests
run: $RUN_TESTS src/embed_tests/bin/$EMBED_TESTS_PATH/Python.EmbeddingTest.dll --labels=All
- name: Run Embedding tests
run: dotnet test src/embed_tests/

# TODO: Run perf tests
# TODO: Run tests on macos and windows as well
# TODO: Run tests on Windows on .NET Framework
Loading