|
1 |
| -# This is a basic workflow to help you get started with Actions |
2 |
| - |
3 | 1 | name:GitHub Actions
|
4 | 2 |
|
5 |
| -# Controls when the action will run. |
6 |
| -on: |
7 |
| -# Triggers the workflow on push or pull request events but only for the master branch |
8 |
| -push: |
9 |
| -branches:[ master ] |
10 |
| -pull_request: |
11 |
| -branches:[ master ] |
12 |
| - |
13 |
| -# Allows you to run this workflow manually from the Actions tab |
14 |
| -workflow_dispatch: |
| 3 | +on:[ pull_request, push ] |
15 | 4 |
|
16 |
| -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
17 | 5 | jobs:
|
18 |
| -# This workflow contains a single job called "build" |
19 |
| -build: |
20 |
| -# The type of runner that the job will run on |
21 |
| -runs-on:ubuntu-latest |
| 6 | +build-test: |
| 7 | +name:Build and Test |
| 8 | +runs-on:ubuntu-16.04 |
| 9 | + |
| 10 | +strategy: |
| 11 | +matrix: |
| 12 | +python:[3.6,3.7,3.8,3.9] |
| 13 | +shutdown_mode:[Normal,Soft] |
| 14 | +toolset:[Mono,.NET] |
| 15 | +include: |
| 16 | + -toolset:.NET |
| 17 | +BUILD_OPTS:--xplat |
| 18 | +RUN_TESTS:dotnet |
| 19 | +EMBED_TESTS_PATH:netcoreapp3.1_publish/ |
| 20 | +PERF_TESTS_PATH:net461/ |
| 21 | + -toolset:Mono |
| 22 | +BUILD_OPTS:"" |
| 23 | +RUN_TESTS:"mono ./packages/NUnit.*/tools/nunit3-console.exe" |
| 24 | +EMBED_TESTS_PATH:"" |
| 25 | +PERF_TESTS_PATH:"" |
| 26 | + |
| 27 | +env: |
| 28 | +BUILD_OPTS:${{ matrix.BUILD_OPTS }} |
| 29 | +RUN_TESTS:${{ matrix.RUN_TESTS }} |
| 30 | +EMBED_TESTS_PATH:${{ matrix.EMBED_TESTS_PATH }} |
| 31 | +PERF_TESTS_PATH:${{ matrix.PERF_TESTS_PATH }} |
| 32 | +PYTHONNET_SHUTDOWN_MODE:${{ matrix.SHUTDOWN_MODE }} |
22 | 33 |
|
23 |
| -# Steps represent a sequence of tasks that will be executed as part of the job |
24 | 34 | steps:
|
25 |
| -# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
26 |
| - -uses:actions/checkout@v2 |
| 35 | + -name:Checkout code |
| 36 | +uses:actions/checkout@v2 |
| 37 | + |
| 38 | + -name:Install Mono |
| 39 | +if:${{ matrix.toolset == 'Mono' }} |
| 40 | +run:| |
| 41 | + sudo apt update |
| 42 | + sudo apt install mono-devel ca-certificates-mono -y |
27 | 43 |
|
28 |
| -# Runs a single command using the runners shell |
29 |
| - -name:Run a one-line script |
30 |
| -run:echo Hello, world! |
| 44 | + -name:Install .NET |
| 45 | +if:${{ matrix.toolset == '.NET' }} |
| 46 | +uses:actions/setup-dotnet@v1 |
| 47 | +with: |
| 48 | +dotnet-version:3.1.x |
31 | 49 |
|
32 |
| -# Runs a set of commands using the runners shell |
33 |
| - -name:Run a multi-line script |
| 50 | + -name:Set up Python ${{ matrix.python }} |
| 51 | +uses:actions/setup-python@v2 |
| 52 | +with: |
| 53 | +python-version:${{ matrix.python }} |
| 54 | + |
| 55 | + -name:Install dependencies |
| 56 | +run:| |
| 57 | + pip install --upgrade setuptools # TEMP - due to setuptools 36.2.0 bug |
| 58 | + pip install --upgrade -r requirements.txt |
| 59 | +
|
| 60 | + -name:Install |
34 | 61 | run:|
|
35 |
| - echo Add other actions to build, |
36 |
| - echo test, and deploy your project. |
| 62 | + echo $BUILD_OPTS |
| 63 | + python setup.py install $BUILD_OPTS |
| 64 | +
|
| 65 | + -name:Python Tests |
| 66 | +run:pytest |
| 67 | + |
| 68 | + -name:.NET Tests |
| 69 | +run:$RUN_TESTS src/embed_tests/bin/$EMBED_TESTS_PATH/Python.EmbeddingTest.dll --labels=All |