-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (58 loc) · 1.58 KB
/
push.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
name: nrf-sniffer-cli
on:
push:
branches: [main]
paths-ignore: ['**.md']
pull_request:
paths-ignore: ['**.md']
schedule:
- cron: 30 3 * * *
release:
types: [ created ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
run: |
pip install .
pip install .[dev]
- name: run tests
run: python -m pytest --cov SnifferAPI --cov-report=html .
- name: pylint (always pass)
run: pylint --exit-zero SnifferAPI
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: htmlcov/*
publish:
needs: [test]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
pip install .
pip install setuptools wheel twine
- name: create packages
run: |
python setup.py sdist
python setup.py bdist_wheel
- name: publish to pypi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*