Skip to content

Commit 8a2c20a

Browse files
committed
workflow with tox, publish workflow
1 parent 305767d commit 8a2c20a

File tree

3 files changed

+65
-14
lines changed

3 files changed

+65
-14
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,55 @@
1-
name: Run tests
2-
1+
name: Tests
32
on:
43
push:
54
branches: [ master ]
65
pull_request:
76
branches: [ master ]
87

8+
99
jobs:
10-
build:
10+
tests:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
fail-fast: false
14-
matrix:
15-
python-version: ["3.6", "3.7", "3.8", "3.9"]
14+
matrix:
15+
include:
16+
- python-version: "3.6"
17+
env:
18+
TOXENV: "msgpack"
19+
- python-version: "3.6"
20+
env:
21+
TOXENV: "json"
22+
- python-version: "3.7"
23+
env:
24+
TOXENV: "msgpack"
25+
- python-version: "3.7"
26+
env:
27+
TOXENV: "json"
28+
- python-version: "3.8"
29+
env:
30+
TOXENV: "msgpack"
31+
- python-version: "3.8"
32+
env:
33+
TOXENV: "json"
34+
- python-version: "3.9"
35+
env:
36+
TOXENV: "msgpack"
37+
- python-version: "3.9"
38+
env:
39+
TOXENV: "json"
40+
1641
steps:
1742
- uses: actions/checkout@v2
18-
- name: Set up Python ${{ matrix.python-version}}
43+
- name: Set up Python ${{ matrix.python-version }}
1944
uses: actions/setup-python@v2
2045
with:
21-
python-version: ${{matrix.python-version}}
46+
python-version: ${{ matrix.python-version }}
2247

23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
27-
pip install -r requirements-test.txt
2848
- name: Run tests
49+
env: ${{ matrix.env }}
2950
run: |
30-
pytest
51+
pip install -U tox
52+
tox
53+
54+
- name: Upload coverage report
55+
run: bash <(curl -s https://codecov.io/bash)

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Python 3
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3
17+
18+
- name: Build distribution
19+
run: |
20+
pip install -U setuptools wheel
21+
python setup.py sdist bdist_wheel
22+
23+
- name: Publish to PyPI
24+
uses: pypa/gh-action-pypi-publish@release/v1
25+
with:
26+
password: ${{ secrets.PYPI_TOKEN }}

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py{27,py,35,36,37}-{json,msgpack}
7+
envlist = py{36,37,38,39}-{json,msgpack}
88

99
[testenv]
1010
deps =

0 commit comments

Comments
 (0)