From 90294b50fa220b7642de0774a98e8cb3062479fc Mon Sep 17 00:00:00 2001 From: EdgeNeko Date: Sun, 12 May 2024 18:39:04 +0800 Subject: [PATCH] Add code coverage test --- .github/workflows/test_lint.yml | 6 +++++- requirements.dev.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_lint.yml b/.github/workflows/test_lint.yml index 48cf96f..233abf5 100644 --- a/.github/workflows/test_lint.yml +++ b/.github/workflows/test_lint.yml @@ -28,7 +28,11 @@ jobs: pip install -r requirements.dev.txt - name: Test the code with pytest run: | - pytest . + pytest --cov=app . + - name: Upload coverage reports to Codecov with GitHub Action + uses: codecov/codecov-action@v4.2.0 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Analysing the code with pylint run: | pylint --rc-file pylintrc.toml -j 0 app scripts tests && lint_result=$? || lint_result=$? diff --git a/requirements.dev.txt b/requirements.dev.txt index 8be78ef..2b30bbc 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -2,4 +2,5 @@ pytest pytest-asyncio +pytest-cov pylint \ No newline at end of file