Skip to content

Commit cd64c93

Browse files
committed
Add CI.
1 parent 309a56c commit cd64c93

File tree

5 files changed

+55
-1
lines changed

5 files changed

+55
-1
lines changed

.github/workflows/tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
name: Tests
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os:
14+
- ubuntu-18.04
15+
- windows-2019
16+
env:
17+
- PYTHON_VERSION: 2.7
18+
- PYTHON_VERSION: 3.7
19+
steps:
20+
- uses: actions/checkout@master
21+
# Nox runner
22+
- name: Set up Python 3.7
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: 3.7
26+
- name: Set up Python ${{ matrix.env.PYTHON_VERSION }}
27+
if: matrix.env.PYTHON_VERSION != '3.7'
28+
uses: actions/setup-python@v1
29+
with:
30+
python-version: ${{ matrix.env.PYTHON_VERSION }}
31+
- name: Install nox (Unix)
32+
run: python3.7 -m pip install nox
33+
if: matrix.os != 'windows-2019'
34+
- name: Install nox (Windows)
35+
run: py -3.7 -m pip install nox
36+
if: matrix.os == 'windows-2019'
37+
- name: Workaround for Windows Python 2.7
38+
run: rm C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/opt/bin/python2.7.exe
39+
if: matrix.os == 'windows-2019' && matrix.env.PYTHON_VERSION == '2.7'
40+
- name: Run tests
41+
run: nox -s tests-${{ matrix.env.PYTHON_VERSION }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
venv
1+
/.nox/
2+
/venv/
3+
__pycache__/

noxfile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import os
2+
3+
import nox
4+
5+
6+
@nox.session(python=['2.7', '3.7'])
7+
def tests(session):
8+
session.install('pytest')
9+
session.run('pytest')

tests/__init__.py

Whitespace-only changes.

tests/test_basics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_basics():
2+
pass

0 commit comments

Comments
 (0)