Here is a list of 15 plus continuous integration tips or do’s and don’ts for your software. If you have more tips, please add them to the comment section. I will pick it up from there and add it to this list.
- Maintain single source code repository
- Commit code frequently. Ideally have everyone in your team commit their code everyday.
- Run all test cases / test suites locally before committing your code to the repository.
- Never check-in a broken build – if you found broken test cases, fix those before committing the code.
- If you checked in a code that broke the build, fix it. Take responsibility on the build that you broke.
- Don’t comment out failing test cases – fix them.
- Automate the build process using tools like Ant or Maven.
- Automate the unit tests so that on every build whole set of test cases run.
- Make a clear separation of Unit Tests and Integratio Tests
- Configure the build so that every commit to the repository triggers a build.
- Keep the builds fast – fail the build if it runs for too long and optimize the build process.
- Replicate production environment as closely as possible on your test environments.
- Make the results of your test cases visible to everyone in your team.
- Send an email to the team for every build – both for success and failure.
- Auotmate your deployment process – ideally set up a trigger to run a deployment once the build is complete.
- Run static code analysis tools like checkstyle on your every build and fail the build in case of violations.