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 = [