From 8b88c5dc3492e892b9f03cef335bb33bc9207404 Mon Sep 17 00:00:00 2001 From: Cosmin Ciocan Date: Fri, 5 Jan 2024 15:17:55 +0100 Subject: [PATCH] Add code coverage job in testing workflow --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30af8a2..6fd78e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,3 +48,39 @@ jobs: - name: Run pytest run: | pytest -v + + # upload code coverage report + code-coverage: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + lfs: "true" + - run: git lfs pull + + - name: Set up Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: "3.10" + + - name: Install CUDA tools + run: | + sudo apt update + sudo apt install nvidia-cuda-toolkit + sudo mkdir -p /usr/lib/x86_64-linux-gnu/nsight-compute/sections + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install -r tests/requirements.txt + pip install pytest-cov[toml] + + - name: Run tests and collect coverage + run: pytest --cov nvcc4jupyter + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}