Task 7: Tests on Every Push

In this task the branch workflow's placeholders become real.

Lint the code

  • ruff check and ruff format --check. FastAPI track: mypy as well.

Run the unit tests

  • pytest with coverage; fail under a threshold. TODO: the threshold.
  • actions/setup-python with pip caching.
  • A matrix of Python versions. TODO: which.

Run the same checks before pushing

  • TODO: what runs outside the GitHub-hosted runners: pre-commit on the student's machine? a self-hosted runner?

Break a test, and read the run

  • Push a failing test; read the failure in the log and in the pull request's checks.

Translations: