Skip to content

Commit

Permalink
workflow with tox, publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelmhm committed Dec 27, 2021
1 parent 305767d commit 40cec82
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 19 deletions.
56 changes: 38 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
name: Run tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Tests
on: [push, pull_request]

jobs:
build:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
matrix:
include:
- python-version: "3.6"
env:
TOXENV: "msgpack"
- python-version: "3.6"
env:
TOXENV: "json"
- python-version: "3.7"
env:
TOXENV: "msgpack"
- python-version: "3.7"
env:
TOXENV: "json"
- python-version: "3.8"
env:
TOXENV: "msgpack"
- python-version: "3.8"
env:
TOXENV: "json"
- python-version: "3.9"
env:
TOXENV: "msgpack"
- python-version: "3.9"
env:
TOXENV: "json"

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version}}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python-version}}
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Run tests
env: ${{ matrix.env }}
run: |
pytest
pip install -U tox
tox
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: 3

- name: Build distribution
run: |
pip install -U setuptools wheel
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

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

[testenv]
deps =
Expand Down

0 comments on commit 40cec82

Please sign in to comment.