Skip to content

Commit

Permalink
Add tests on windows and macos
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkedev committed Mar 9, 2020
1 parent 94d27c7 commit e9b0546
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 8 deletions.
73 changes: 68 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: build
on: [push]

jobs:
build:
Linux:
runs-on: ubuntu-latest
env:
PIPENV_VENV_IN_PROJECT: true

steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand All @@ -17,19 +19,80 @@ jobs:

- uses: actions/cache@v1
with:
path: ~/.cache/pip
path: .venv
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile.lock') }}

- name: Install dependencies
run: |
pip install --upgrade pip
pip install pipenv tox
pipenv install --dev
pipenv install --dev --skip-lock
- name: Run tests
run: tox
run: tox -e unix

- name: Upload coverage report
run: pipenv run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

MacOS:
runs-on: macos-latest
env:
PIPENV_VENV_IN_PROJECT: true

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

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Cache dependencies
uses: actions/cache@v1
with:
path: .venv
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile.lock') }}

- name: Install dependencies
run: |
pip install --upgrade pip
pip install pipenv tox
pipenv install --dev --skip-lock
- name: Run tests
run: tox -e unix


Windows:
runs-on: windows-latest
env:
PIPENV_VENV_IN_PROJECT: true

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

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Cache dependencies
uses: actions/cache@v1
with:
path: .venv
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile.lock') }}

- name: Install dependencies
shell: cmd
run: |
pip install --upgrade pip
pip install pipenv tox
pipenv install --dev --skip-lock
- name: Run tests
shell: cmd
run: tox -e windows
2 changes: 1 addition & 1 deletion bin/check
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export MPR_SERVER='http://localhost:8080'

set -e
pipenv run flake8
pipenv run flake8 mpr
pipenv run coverage erase
pipenv run coverage run --parallel-mode -m pytest
pipenv run coverage run --parallel-mode -m behave -m --tags="-pending"
Expand Down
2 changes: 1 addition & 1 deletion bin/lint
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
pipenv run flake8
pipenv run flake8 mpr
8 changes: 7 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ paths = test/features

[tox]
requires = pipenv
envlist = {unix,windows}-{3.7,3.8}

[testenv]
[testenv:unix]
platform = linux|darwin
whitelist_externals = check
commands = {toxinidir}/bin/check
setenv =
Expand All @@ -25,3 +27,7 @@ deps =
pytest-asyncio
behave
coverage==4.5.3

[testenv:windows]
platform = win32
commands = {toxinidir}\bin\check

0 comments on commit e9b0546

Please sign in to comment.