If you build on the machine you will deploy to, the tests won't pass. Problem solved.
If you build on an earlier machine where the tests pass and deploy to a later one and then don't check that the deployment works, you are at risk.
I think proper testing covers both options.