-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (59 loc) · 1.56 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI
on:
pull_request:
push:
branches:
- "master"
tags:
- "[0-9].[0-9].[0-9]"
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
tests:
runs-on: ${{ matrix.machine }}
strategy:
matrix:
include:
- python-version: "3.6"
machine: ubuntu-20.04
- python-version: "3.7"
machine: ubuntu-22.04
- python-version: "3.8"
machine: ubuntu-22.04
- python-version: "3.9"
machine: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Install tox
run: python -m pip install tox tox-gh-actions
- name: Run tox
run: python -m tox
- name: Coveralls
run: |
python -m pip install codecov
codecov
deploy:
runs-on: ubuntu-latest
needs:
- pre-commit
- tests
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install pypa/build
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}