-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (51 loc) · 1.5 KB
/
pythonpackage.yml
File metadata and controls
57 lines (51 loc) · 1.5 KB
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
---
name: Python package
# yamllint disable-line rule:truthy
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .
- name: Lint with pylint
run: |
pip install pylint
pylint --reports=y --exit-zero config_resolver
- name: Test with pytest
run: |
pip install pytest pytest-coverage
chmod 600 tests/examples/configs/secure.ini
pytest -rsf
build:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build distribution
if: "github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags')"
run: |
pip install wheel
python setup.py sdist
python setup.py bdist_wheel
- name: Publish package
if: "github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags')"
uses: "pypa/gh-action-pypi-publish@\
e777b33388fefa46ce597d8afa9c15a5357af36f"
with:
user: __token__
password: ${{ secrets.pypi_token }}