diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..2cea4ce --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Pytest Coverage, Coveralls + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest coverage + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -e . + - name: Test with coverage + run: | + coverage run --source allantools setup.py test + coverage html + coverage report + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v2.2.3 + diff --git a/coverage.sh b/coverage.sh index 9917911..73a9194 100755 --- a/coverage.sh +++ b/coverage.sh @@ -4,6 +4,6 @@ # works at least on Ubuntu 16.04LTS # AW2016-11-13 -python-coverage run --source allantools setup.py test -python-coverage html -python-coverage report +python3-coverage run --source allantools setup.py test +python3-coverage html +python3-coverage report diff --git a/pytest.ini b/pytest.ini index 54c994c..8e54a91 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,5 @@ [pytest] markers = slow: marks tests as slow (deselect with '-m "not slow"') +testpaths = + tests