-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (45 loc) · 1.44 KB
/
main.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
name: Test and deploy package
on: [push, pull_request]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt
pip install -r requirements_develop.txt
- name: Test package
run: |
python -m pytest --cov-config .coveragerc --cov worklog --cov-report=xml worklog/
- name: Upload pytest test results
uses: actions/upload-artifact@v1
with:
name: pytest-coverage-report
path: coverage.xml
# Use always() to always run this step to publish test results when there
# are test failures
if: ${{ always() }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
env_vars: OS,PYTHON
fail_ci_if_error: true
path_to_write_report: ./codecov_report.gz
- name: Build and publish
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*