Add GitHub Actions testing workflow (#24)

* Add GitHub Actions testing workflow

* Update named Python versions and dev status

* Use unittest.mock as default mock source

Fall back to package for Python 2.7

* Try installing mock outside of setup

* Switch to GitHub actions shield
This commit is contained in:
Ben Lopatin
2019-10-06 12:04:51 -04:00
committed by GitHub
parent 9198a1d549
commit be74c4e5b7
4 changed files with 33 additions and 6 deletions
+23
View File
@@ -0,0 +1,23 @@
name: Tests
on: [push]
jobs:
test:
name: Test on Python ${{ matrix.py_version }}
runs-on: ubuntu-latest
strategy:
matrix:
py_version: [2.7, 3.5, 3.6, 3.7]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.py_version }}
- name: Install mock for Python 2.7
run: pip install mock
- name: Run tests
run: python setup.py test
+2 -2
View File
@@ -2,9 +2,9 @@
pydiscourse
===========
.. image:: https://secure.travis-ci.org/bennylope/pydiscourse.svg?branch=master
.. image:: https://github.com/bennylope/pydiscourse/workflows/Tests/badge.svg
:alt: Build Status
:target: http://travis-ci.org/bennylope/pydiscourse
:target: https://github.com/bennylope/pydiscourse/actions
.. image:: https://img.shields.io/badge/Check%20out%20the-Docs-blue.svg
:alt: Check out the Docs
+3 -2
View File
@@ -34,15 +34,16 @@ setup(
]
},
classifiers=[
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable"
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
'Programming Language :: Python :: Implementation :: PyPy',
],
zip_safe=False,
+5 -2
View File
@@ -1,10 +1,13 @@
import sys
import unittest
import mock
try:
from unittest import mock
except ImportError:
import mock
from pydiscourse import client
import sys
if sys.version_info < (3,):