-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (64 loc) · 1.88 KB
/
main.yaml
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
62
63
64
65
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.2"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Check poetry file itself
run: poetry check
- name: Install package
run: poetry install
env:
PYTHON_KEYRING_BACKEND: "keyring.backends.null.Keyring"
- name: Lint
run: poetry run flake8 .
- name: Autoformat check
run: poetry run black .
- name: Isort import order check
run: poetry run isort -c .
- name: Unit tests
run: poetry run pytest
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run coveralls --service=github
package:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
needs: test
steps:
- uses: actions/checkout@v3
- name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.2.2"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Install package
run: poetry install
env:
PYTHON_KEYRING_BACKEND: "keyring.backends.null.Keyring"
- name: Create packages
run: |
poetry run python setup.py sdist
poetry run python setup.py bdist_wheel
- name: Publish to test PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}