Skip to content

Tox testing

Tox testing #1119

Workflow file for this run

name: Tox testing
on:
schedule:
- cron: '40 3 * * *'
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
workflow_dispatch:
inputs:
ref:
description: 'Git ref to checkout'
required: true
default: 'master'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v1
with:
ref: ${{ github.event.inputs.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "tox<4"
sudo apt-get update
sudo apt-get install -y tmux
- name: Test with tox
run: |
pyenv="py$(echo "${{ matrix.python-version }}" | tr -d '.')"
tox -e ${pyenv}-test,flake8,pylint
- name: Upload Coverage to Codecov
uses: codecov/[email protected]
with:
flags: ${{ matrix.python-version }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
if: >-
matrix.python-version == 3.9 &&
github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: .tox/dist/