Run tests after every push
The core rule of Continuous Integration is to test every single change before integrating it with main line of code. With Buddy, you can easily configure a pipeline that automatically runs tests whenever a change is pushed to the repository.
The first step is adding a project and attaching the Git repository that you want to test. Buddy features dedicated integrations with GitHub, Bitbucket, and GitLab, but you can easily add custom repositories from any server. If you wish to keep your CI/CD process in one place, you can host your projects directly on Buddy as well.
Once the project is added and synchronized, you are ready to add your CI pipeline. If you want to test every change introduced to the repository, regardless if it's a branch, a tag, or a pull request, configure the pipeline as follows:
- Switch the trigger mode to the Git push event.
- Set the code scope to Wildcard.
- Set the wildcard match to
You can also limit the pipeline to specific refs. For example, if you want to limit it to branches, set the pattern to:
Adding new pipeline
After specifying when your pipeline should be triggered, you need to define what it should do. In this example, we'll add an action which installs dependencies and runs unit tests on the application. Buddy offers pre-configured test environments for all popular languages and frameworks:
Build actions and task runners
Clicking a build action brings up its configuration details. Here you can specify the desired commands – in this case
npm install and
Build action with test ommands
As all actions in the pipeline share the same filesystem with repository files and artifacts, you can split the commands into two separate actions:
On top of the build actions, you can add a notification action that will send a message to your team in case the tests have failed. Buddy lets you send messages via e-mail or SMS, and integrates with a wide array of communication services, including Slack, Discord, MS Teams, and Telegram. To restrict notifications to failed runs only, switch to the On Failure tab and add the desired messaging action:
On failure section
With Buddy, you can automate not only unit tests, but also static analysis, end-to-end, integration and browsers tests, Selenium, and more. All you need to do is to extend your pipeline with proper actions. For example, adding the ESLint action will run a static analysis on your code:
ESlint pipeline example
Last modified on July 13, 2023