From 806c52f0a29ffa809d3bbff57b6c83dae665b917 Mon Sep 17 00:00:00 2001 From: EdgeNeko Date: Wed, 21 Aug 2024 20:44:25 +0800 Subject: [PATCH] Add test result report & coverage for both python versions --- .github/workflows/test_lint.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_lint.yml b/.github/workflows/test_lint.yml index cf855b6..a52488c 100644 --- a/.github/workflows/test_lint.yml +++ b/.github/workflows/test_lint.yml @@ -37,14 +37,20 @@ jobs: pip install -r requirements.dev.txt - name: Test the code with pytest run: | - pytest --cov=app . + pytest --cov=app --junitxml=junit.xml . + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: "python-${{ matrix.python-version }}" - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v4.2.0 - if: ${{ matrix.python-version == '3.11' }} # Only upload coverage reports for the latest Python version - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + # if: ${{ matrix.python-version == '3.11' }} # Only upload coverage reports for the latest Python version + with: + flags: "python-${{ matrix.python-version }}" + 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=$? exit $(( $lint_result & 35 )) -