Skip to content

[pre-commit.ci] pre-commit autoupdate #304

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #304

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- v*
pull_request:
jobs:
tox:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [macOS-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ runner.os }}-pip-${{ hashFiles('pyproject.toml', 'setup.py',
'setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install
run: |
pip install tox
- name: tox
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: tox -e py,lint,coveralls,release
- name: upload dist
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}_${{ matrix.python-version}}_dist
path: dist
all-successful:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest
needs: [tox]
steps:
- name: Download dists for PyPI
uses: actions/download-artifact@v2
with:
name: ubuntu-latest_3.8_dist
path: dist
- name: Display structure of donwloaded files
run: ls -R
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: note that all tests succeeded
run: echo "🎉"