Skip to content

Commit

Permalink
ci(coverage): use Coveralls action and pytest-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Feb 11, 2021
1 parent 62f0c0e commit 86adb7f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
4 changes: 1 addition & 3 deletions .coveragerc
@@ -1,10 +1,8 @@
# .coveragerc to control coverage.py
[run]
include =
guessit/*
omit =
guessit/__version__.py
guessit/test/*
[report]
exclude_lines =
pragma: no cover
pragma: no cover
25 changes: 18 additions & 7 deletions .github/workflows/ci.yml
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Test
run: |
pip install coveralls
coverage run --source=guessit setup.py test
pytest --cov=guessit
env:
REBULK_REGEX_ENABLED: ${{ matrix.regex }}

Expand All @@ -63,7 +63,18 @@ jobs:
coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: Python ${{ matrix.python-version }}${{ fromJSON('["", " (regex)"]')[matrix.regex == '1'] }}
COVERALLS_PARALLEL: "true"

coveralls-finish:
needs: [ ci ]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

commitlint:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Expand All @@ -78,7 +89,7 @@ jobs:

build-setuptools:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
needs: [ ci ]

runs-on: ubuntu-latest

Expand Down Expand Up @@ -115,7 +126,7 @@ jobs:

build-bin-linux:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
needs: [ ci ]

runs-on: ubuntu-latest

Expand Down Expand Up @@ -156,7 +167,7 @@ jobs:

build-bin-windows:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
needs: [ ci ]

runs-on: windows-latest

Expand Down Expand Up @@ -196,7 +207,7 @@ jobs:

build-bin-macos:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
needs: [ ci ]

runs-on: macos-latest

Expand Down Expand Up @@ -236,7 +247,7 @@ jobs:

release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: [commitlint, build-setuptools, build-bin-linux, build-bin-windows, build-bin-macos]
needs: [ commitlint, build-setuptools, build-bin-linux, build-bin-windows, build-bin-macos ]

runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -21,7 +21,7 @@

dev_require = ['tox', 'mkdocs', 'mkdocs-material', 'pyinstaller', 'python-semantic-release']

tests_require = ['pytest', 'pytest-benchmark', 'pylint', 'PyYAML']
tests_require = ['pytest', 'pytest-benchmark', 'pytest-cov', 'pylint', 'PyYAML']

package_data = ['config/*', 'data/*']

Expand Down

0 comments on commit 86adb7f

Please sign in to comment.