From d631ceb03c14ced2237b82b25c75d2776d14c5f5 Mon Sep 17 00:00:00 2001 From: Jonas Depoix Date: Mon, 11 Nov 2024 15:57:34 +0100 Subject: [PATCH] coverage report stage will now fail immediatelly --- .github/workflows/ci.yml | 13 ++++++++++++- pyproject.toml | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e80d980..bbfe110 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,10 +62,21 @@ jobs: with: parallel-finished: true carryforward: "run-python-3.8,run-python-3.9,run-python-3.10,run-python-3.11,run-python-3.12,run-python-3.13" + - uses: actions/checkout@v4 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - name: Install dependencies + run: | + pip install poetry poethepoet + poetry install --only test + - name: Check coverage + run: poe coverage-report publish: if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - needs: report-coverage + needs: [report-coverage, static-checks] runs-on: ubuntu-latest steps: diff --git a/pyproject.toml b/pyproject.toml index ba5397b..f410135 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,8 @@ youtube_transcript_api = "youtube_transcript_api.__main__:main" [tool.poe.tasks] test = "pytest youtube_transcript_api" ci-test.shell = "coverage run -m unittest discover && coverage xml" -coverage.shell = "coverage run -m unittest discover && coverage report -m" +coverage.shell = "coverage run -m unittest discover && coverage report -m --fail-under=100" +coverage-report = "coverage report -m --fail-under=100" format = "ruff format youtube_transcript_api" ci-format = "ruff format youtube_transcript_api --check" lint = "ruff check youtube_transcript_api"