From cb683c34d8bcfd83bd0c8d7c143163584f15f991 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Thu, 31 Oct 2024 15:29:25 +0000 Subject: [PATCH] ci: Send coverage report to codecov --- .github/workflows/checks.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 352e023..396498c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -31,6 +31,30 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 + coverage: + name: Code coverage + runs-on: ubuntu-latest + + steps: + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Run tests and collect coverage + run: | + tox -- coverage run test.py && coverage xml + + - name: Upload coverage to Codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + uses: codecov/codecov-action@v4 + tests: name: Unit Tests runs-on: ${{ matrix.platform }}