Skip to content

Commit a28ae79

Browse files
authored
Setup basic GitHub actions
1 parent 116637a commit a28ae79

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/main.yml

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

0 commit comments

Comments
 (0)