-
Notifications
You must be signed in to change notification settings - Fork 10
43 lines (38 loc) · 1.21 KB
/
cicd.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
name: CI
on: [push, pull_request]
jobs:
ci:
runs-on: ${{ matrix.python-version == '3.6' && 'ubuntu-20.04' || 'ubuntu-latest' }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: pip install -U pip poetry
- run: poetry config virtualenvs.create false
- run: poetry install
- run: flake8 --max-line-length 88 src/ tests/
- run: black --diff --check src/ tests/
- run: mypy src/ tests/
- run: pytest
cd:
needs: [ci]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
if: startsWith(github.event.ref, 'refs/tags')
uses: actions/setup-python@v2
with:
python-version: "3.10"
- run: pip install -U pip poetry
- name: Publish package
if: startsWith(github.event.ref, 'refs/tags')
run: |
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}