From 4f3f94046d79a794bca1be1dd3daaab021c30802 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Sat, 27 Apr 2024 21:16:10 -0400 Subject: [PATCH] Add Codecov support --- .github/workflows/run_test.yml | 17 ++++++++++++++++- .gitignore | 3 ++- README.md | 2 ++ pyproject.toml | 11 ++++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index ddfd55c..b4bdcfe 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -46,10 +46,25 @@ jobs: # We need to conserve mkvtoolnix in the PATH env variable. # From https://stackoverflow.com/a/73981698/15835974 - - name: Install pytest + - name: Install pytest and coverage run: | pip install pytest + pip install coverage - name: Run tests run: | pytest + + - name: Generate coverage report + run: | + coverage run -m pytest + coverage xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + env_vars: OS,PYTHON + fail_ci_if_error: true + flags: unittests + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.gitignore b/.gitignore index 7ec5b43..82f2cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ build/ dist/ .idea/ .vscode/ -venv/ \ No newline at end of file +venv/ +.coverage \ No newline at end of file diff --git a/README.md b/README.md index e79fe8e..2a9a207 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # FontCollector +![Codecov](https://app.codecov.io/github/moi15moi/FontCollector) + FontCollector for Advanced SubStation Alpha file. This tool allows to recover and/or mux the fonts necessary in an mkv. ## Installation diff --git a/pyproject.toml b/pyproject.toml index e5fd0b5..3d65e8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,4 +66,13 @@ ignore_missing_imports = true [[tool.mypy.overrides]] module = "freetype.*" -ignore_missing_imports = true \ No newline at end of file +ignore_missing_imports = true + +[tool.coverage.report] +include = [ + "font_collector/*", + ] +exclude_also = [ + # Don't complain about abstract methods, they aren't run: + "@(abc\\.)?abstractmethod", + ]