Skip to content

Commit 6edbe85

Browse files
authored
Add GitHub actions workflow for build and deploy (#156)
1 parent 58b5048 commit 6edbe85

File tree

4 files changed

+85
-66
lines changed

4 files changed

+85
-66
lines changed

.github/workflows/main.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: pytest plugin
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python: ["2.7", "3.5", "3.6", "3.7"]
14+
os: [ubuntu-latest, windows-latest]
15+
include:
16+
- python: "2.7"
17+
tox_env: "py27"
18+
- python: "3.5"
19+
tox_env: "py35"
20+
- python: "3.6"
21+
tox_env: "py36"
22+
- python: "3.7"
23+
tox_env: "py37"
24+
25+
steps:
26+
- uses: actions/checkout@v1
27+
- name: Set up Python
28+
uses: actions/setup-python@v1
29+
with:
30+
python-version: ${{ matrix.python }}
31+
- name: Install tox
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install tox
35+
- name: Test
36+
run: |
37+
tox -e ${{ matrix.tox_env }}
38+
39+
linting:
40+
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v1
45+
- name: Set up Python
46+
uses: actions/setup-python@v1
47+
with:
48+
python-version: "3.7"
49+
- name: Install tox
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install tox
53+
- name: Linting
54+
run: |
55+
tox -e linting
56+
57+
deploy:
58+
59+
runs-on: ubuntu-latest
60+
61+
needs: [build, linting]
62+
63+
64+
steps:
65+
- uses: actions/checkout@v1
66+
- name: Set up Python
67+
uses: actions/setup-python@v1
68+
with:
69+
python-version: "3.7"
70+
- name: Install wheel
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install wheel
74+
- name: Build package
75+
run: |
76+
python setup.py sdist bdist_wheel
77+
- name: Publish package to PyPI
78+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
79+
uses: pypa/gh-action-pypi-publish@master
80+
with:
81+
user: __token__
82+
password: ${{ secrets.pypi_token }}

.travis.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

README.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,16 @@ of a test:
2424
2525
2626
27-
|python| |version| |anaconda| |ci| |appveyor| |coverage| |black|
27+
|python| |version| |anaconda| |ci| |coverage| |black|
2828

2929
.. |version| image:: http://img.shields.io/pypi/v/pytest-mock.svg
3030
:target: https://pypi.python.org/pypi/pytest-mock
3131

3232
.. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-mock.svg
3333
:target: https://anaconda.org/conda-forge/pytest-mock
3434

35-
.. |ci| image:: http://img.shields.io/travis/pytest-dev/pytest-mock.svg
36-
:target: https://travis-ci.org/pytest-dev/pytest-mock
37-
38-
.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/pid1t7iuwhkm9eh6/branch/master?svg=true
39-
:target: https://ci.appveyor.com/project/pytestbot/pytest-mock
35+
.. |ci| image:: https://github.com/pytest-dev/pytest-mock/workflows/main/badge.svg
36+
:target: https://github.com/pytest-dev/pytest-mock/actions
4037

4138
.. |coverage| image:: http://img.shields.io/coveralls/pytest-dev/pytest-mock.svg
4239
:target: https://coveralls.io/r/pytest-dev/pytest-mock

appveyor.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)