Added coverage and artifact upload to the test workflow
This commit is contained in:
parent
6873652433
commit
74d10fc8fe
|
|
@ -1,13 +1,23 @@
|
|||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
||||
|
||||
name: Python application
|
||||
name: Python test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- '**.py'
|
||||
- 'src/kiplot'
|
||||
- 'tests/**'
|
||||
- '.github/workflows/pythonapp.yml'
|
||||
tags-ignore:
|
||||
- "v*"
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- '**.py'
|
||||
- 'src/kiplot'
|
||||
- 'tests/**'
|
||||
- '.github/workflows/pythonapp.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -17,11 +27,6 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# python -m pip install --upgrade pip
|
||||
# pip install flake8 pytest
|
||||
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
|
|
@ -29,5 +34,18 @@ jobs:
|
|||
# exit-zero treats all errors as warnings.
|
||||
flake8 . --count --exit-zero --statistics
|
||||
- name: Test with pytest
|
||||
env:
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
run: |
|
||||
pytest-3
|
||||
python3-coverage erase
|
||||
pytest-3 --test_dir output
|
||||
python3-coverage report
|
||||
python3-coverage html -d output/htmlcov
|
||||
coveralls
|
||||
- name: Store results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Test_Output
|
||||
path: output
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue