Skip to content

Commit

Permalink
code coverage (#79)
Browse files Browse the repository at this point in the history
* add codecov.yml

* change tests to test

* condition

* windows

* install coverage

* remove conditions

* revert remove conditions

* check build failure

* code coverage

* Revert "check build failure"

This reverts commit bc06b3f.

* del codecov.yml

Co-authored-by: Chi Wang (MSR) <[email protected]>
Co-authored-by: Chi Wang <[email protected]>
Co-authored-by: Eric Zhu <[email protected]>
  • Loading branch information
4 people authored Apr 27, 2021
1 parent 730fd14 commit 3e991e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
branch = True
source = flaml
omit =
*tests*
*test*
6 changes: 5 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: ['main']
pull_request:
branches: ['*']
branches: ['main']

jobs:
build:
Expand Down Expand Up @@ -49,13 +49,17 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
if: ${{ matrix.python-version != '3.7' || matrix.os == 'macos-latest' }}
run: |
pytest test
- name: Coverage
if: ${{ matrix.python-version == '3.7' && matrix.os != 'macos-latest' }}
run: |
pip install coverage
coverage run -a -m pytest test
coverage xml
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.7' && matrix.os != 'macos-latest' }}
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
Expand Down

0 comments on commit 3e991e4

Please sign in to comment.