Microservices can be built and tested using popular CI/CD tools, such as Jenkins and TeamCity. This is done very similarly to how a build is done in a monolithic application. In a microservices architecture, each microservice is treated like a small application.
For example, once you commit the code in the repository (SCM), CI/CD tools trigger the build process:
Cleaning code
Code compilation
Unit test execution
Contract/acceptance test execution
Building the application archives/container images
Publishing the archives/container images to repository management
Deployment on various delivery environments such as development, quality assurance, and staging environments
Integration and functional test execution
Any other steps
Then, release-build triggers, which change the SNAPSHOT or RELEASE version in pom.xml (in the case of Maven), build the artifacts as described in the normal build trigger, publish the artifacts to the artifacts repository, and tag the version in the repository. If you use the container image, then build the container image as a part of the build.
https://medium.com/@TracyRagan/understanding-microservice-pipelines-ca05b041d3c2