From 80951462837b2ab7139f9a4d0b0991ea1a39fc4d Mon Sep 17 00:00:00 2001 From: Abby Williams Date: Thu, 17 Oct 2024 15:08:27 +0100 Subject: [PATCH] Added coverage.yml --- .github/workflows/coverage.yml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..63f0f40 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,37 @@ +name: Coverage + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install .[dev] + + - name: Run coverage + run: | + pytest --cov-config=.coveragerc --cov=./ci_course --cov-report=xml + cat coverage.xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + files: coverage.xml \ No newline at end of file