Typically this is the workflow of software development:
The developer writes code and unit test cases, makes unit test cases successfully with good code coverage and then commits to source code repository. Though the developer commits to the local repository as she writes the code and unit test cases.
As the code is pushed to source code repository, the continuous integration system kicks in and builds the entire package by taking the code from source code repository. If it fails, the team is notified.