On majors CI/CD, you can isolate tests from the build.
By default, they run the build phase if the tests pass.
Hence, you can have two commands make test and make build, and trigger these commands at the following steps.
For example, you can see what Travis do: docs.travis-ci.com/user/build-stages/
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.