code coverage (#79)

* 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 bc06b3f961d05c923c2974451961f5c252c9e042.

* del codecov.yml

Co-authored-by: Chi Wang (MSR) <chiw@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
Qingyun Wu 2021-04-26 20:04:57 -04:00 committed by GitHub
parent 730fd14ef6
commit 3e991e4352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -2,4 +2,4 @@
branch = True
source = flaml
omit =
*tests*
*test*

View File

@ -7,7 +7,7 @@ on:
push:
branches: ['main']
pull_request:
branches: ['*']
branches: ['main']
jobs:
build:
@ -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