Skip to content

Commit

Permalink
[GHA] fix several codecov issues (#912)
Browse files Browse the repository at this point in the history
* [ci/cd] exclude keras_core/legacy from coverage.run|report,  add backend to codecov flags, move project config to pyproject.toml

* GHA codecov upload, fail ci if error
  • Loading branch information
kiukchung authored Sep 18, 2023
1 parent 2dfe475 commit f38e2e6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 33 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ jobs:
uses: codecov/codecov-action@v3
with:
env_vars: PYTHON,KERAS_BACKEND
flags: keras_core.applications
flags: keras_core.applications,keras_core.applications-${{ matrix.backend }}
files: apps-coverage.xml
fail_ci_if_error: true
- name: Test with pytest
run: |
pytest keras_core --ignore keras_core/applications --cov=keras_core
Expand All @@ -69,8 +70,9 @@ jobs:
uses: codecov/codecov-action@v3
with:
env_vars: PYTHON,KERAS_BACKEND
flags: keras_core
flags: keras_core,keras_core-${{ matrix.backend }}
files: core-coverage.xml
fail_ci_if_error: true

format:
name: Check the code format
Expand Down
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,39 @@ known_first_party = ["keras_core", "tests"]
default_section = "THIRDPARTY"
line_length = 80
extend_skip_glob=["examples/*", "guides/*"]

[tool.pytest.ini_options]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::ImportWarning",
"ignore::RuntimeWarning",
"ignore::PendingDeprecationWarning",
"ignore::FutureWarning",
"ignore::UserWarning",
# Ignore a spurious warning on tf-nightly related to save model changes.
"ignore:Custom mask layers require a config",
]
addopts = "-vv"

# Do not run tests in the `build` folders
norecursedirs = ["build"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"@abstract",
"raise NotImplementedError",
]
omit = [
"*/*_test.py",
"keras_core/legacy/*",
]

[tool.coverage.run]
branch = true
omit = [
"*/*_test.py",
"keras_core/legacy/*",
]

31 changes: 0 additions & 31 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
[tool:pytest]
filterwarnings =
error
ignore::DeprecationWarning
ignore::ImportWarning
ignore::RuntimeWarning
ignore::PendingDeprecationWarning
ignore::FutureWarning
ignore::UserWarning
# Ignore a spurious warning on tf-nightly related to save model changes.
ignore:Custom mask layers require a config

addopts=-vv

# Do not run tests in the `build` folders
norecursedirs = build

[coverage:report]
exclude_lines =
pragma: no cover
@abstract
raise NotImplementedError
omit =
*/*_test.py

[coverage:run]
omit =
*/*_test.py

branch = True

[flake8]
ignore =
# Conflicts with black
Expand Down

0 comments on commit f38e2e6

Please sign in to comment.