From 92c2bdea72bed6e9af09b40b82ee8dc6f0b3d566 Mon Sep 17 00:00:00 2001 From: matt garber Date: Fri, 19 Jul 2024 12:43:07 -0400 Subject: [PATCH] Added CI coverage report (#118) * Added CI coverage report * update action to 3.2 --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++-- pyproject.toml | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 66a5606..389661c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,13 @@ name: CI -on: [push] +on: + pull_request: + paths-ignore: + - 'docs/**' + push: + branches: + - main + paths-ignore: + - 'docs/**' jobs: unittest: name: unit tests @@ -18,7 +26,20 @@ jobs: pip install ".[test]" - name: Test with pytest run: | - export AWS_DEFAULT_REGION=us-east-1; python -m pytest + export AWS_DEFAULT_REGION=us-east-1; python -m pytest --cov-report xml --cov=src tests + + - name: Log missing coverage + run: | + coverage report -m --skip-covered + - name: Generate coverage report + if: github.ref != 'refs/heads/main' + uses: orgoro/coverage@v3.2 + with: + coverageFile: coverage.xml + token: ${{ secrets.GITHUB_TOKEN }} + thresholdAll: .9 + thresholdNew: 1 + thresholdModified: .95 lint: runs-on: ubuntu-22.04 diff --git a/pyproject.toml b/pyproject.toml index ae49140..276cdd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,7 @@ test = [ "freezegun", "moto[s3,athena,sns] == 4.1.5", "pytest", + "pytest-cov", "pytest-mock" ] dev = [