CI implementation for Test Automation using Git Hub Actions
Introduction
This demo is about how to use GitHub Actions to create CI and CD pipeline. As a part of this demo we will implement github actions to build the maven project and trigger the test cases. Few Details on CI-CD first which I will explain in the class and below this is the Steps to do.
CI-CD Introduction
Stages in CI-CD Pipeline

Steps to Do to Implement GitHub Actions
- Create a Java Maven Project
- Add Junit dependency in POM file
- Create a test class and then add add two test cases.
- Run the tests using command: mvn clean install
- One test will pass and other will fail. That is how we have created these test cases, so that we can check the same behavior in the github pipeline.
- Commit the project in a GitHub Repo
- Click on Actions and click on “set up this workflow” link.
- Rename the file as “maven-build.yml” and paste below code in the text editor.
- Once the code is committed, pipeline will be sensitive to the ‘master’ branch push and pr request on the ‘master’ branch and will automatically triggered.
- To check the results go to Actions tab and click on the latest tab.
- Click on the ‘build’ link and expand the logs.
Author:- Created by Akash Tyagi.