How to set thresholds in CI pipeline?

I am new to GitLab, and learning the application. I wanted to know how to set thresholds in CI pipeline for the pipeline stages listed below. If a CI pipeline stage doesn’t pass the threshold the pipeline should fail at that stage:

  1. Unit test coverage,
  2. Code quality scan,
  3. Code smells, and
  4. Vulnerabilities in SAST and DAST scans.

Thanks in advance !