Skip to content

Commit f8c27a1

Browse files
authored
Added github actions workflow to replace travis (#1307)
* drop travis * added github actions workflow to replace travis
1 parent 5b09ba6 commit f8c27a1

File tree

3 files changed

+61
-87
lines changed

3 files changed

+61
-87
lines changed

.github/workflows/main.yml

+60-27
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,69 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: GitHub Actions
42

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 ]
154

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
175
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 }}
2233

23-
# Steps represent a sequence of tasks that will be executed as part of the job
2434
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
2743
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
3149

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
3461
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

.travis.yml

-59
This file was deleted.

pythonnet.15.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{441A0123-F
2424
EndProject
2525
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CI", "CI", "{D301657F-5EAF-4534-B280-B858D651B2E5}"
2626
ProjectSection(SolutionItems) = preProject
27-
.travis.yml = .travis.yml
2827
appveyor.yml = appveyor.yml
2928
ci\appveyor_build_recipe.ps1 = ci\appveyor_build_recipe.ps1
3029
ci\appveyor_run_tests.ps1 = ci\appveyor_run_tests.ps1
30+
.github\workflows\main.yml = .github\workflows\main.yml
3131
EndProjectSection
3232
EndProject
3333
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{57F5D701-F265-4736-A5A2-07249E7A4DA3}"

0 commit comments

Comments
 (0)