Interview Prep/CI/CD/GitHub Actions

You want the workflow to post test coverage on the PR and fail if coverage drops below 80%.

IntermediateScenarioGitHub Actions
Answer

Situation read → Quality gate in CI.

What I'd do →

  1. Generate coverage (pytest --cov --cov-fail-under=80 or JaCoCo check rule).
  2. Upload report as artifact and publish a summary to $GITHUB_STEP_SUMMARY.
  3. Make the job a required status check in branch protection or rulesets.

Why → The tool's own threshold fails the step; branch protection makes the failure block merge.

Interview tip → Prefer "no drop on changed code" to a flat global threshold.

All CI/CD questions

More on GitHub Actions