Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

On This Page
Read on this blog to learn how to set up CI/CD pipeline for test cases using Cypress with GitHub Actions.

Anshita Bhasin
December 29, 2025
Cypress with GitHub Actions is essential for quick feedback on code changes, automating test runs whenever code is pushed or a pull request is made. It ensures consistent, efficient testing without manual intervention.
GitHub Actions simplifies CI/CD by enabling scheduling, parallel testing, and running tests on Docker containers. This blog will walk you through setting up a CI/CD pipeline for Cypress test cases using GitHub Actions.
Integrating CI/CD pipelines is essential for fast feedback on code changes. By using GitHub Actions with Cypress, you can automate the testing process, ensuring tests run every time new code is pushed, speeding up development and improving consistency.
How to Set Up GitHub Actions in Your Git Repository?
Setting up GitHub Actions for your repository is easy and involves configuring a few steps to trigger test automation. Here’s how you can get started:
.github/workflows in your repository. This file defines the structure and sequence of automated tasks that GitHub Actions will perform when triggered by specific events.push or pull_request in the .yml file to trigger automated test execution whenever code is pushed or a pull request is created, ensuring your tests stay up-to-date.How to Run Cypress Tests Using GitHub Actions?
GitHub Actions simplifies the process of running Cypress tests by integrating automated steps directly into your repository. Follow these steps to execute your tests automatically:
cypress-io/github-action to install Cypress, run your tests, and use features like caching and parallel execution for faster setup.How to Run Cypress Tests in Docker Containers Using GitHub Actions?
Running Cypress tests in Docker Containers ensures consistency and isolation across environments. Here’s how you can integrate Docker with GitHub Actions:
Cypress is an open-source framework, which is built on Node.js and comes packaged as an npm module. It uses JavaScript for writing the test cases. As it runs tests directly inside the browser, it is fast compared to the other automation testing tools (or frameworks).
Cypress automation tool has received huge acceptance from QA and Developers and is constantly gaining popularity due to its features like easy installation, easy debugging, real-time reloads, and ease of use.
Below are some of the features, which make it unique from other web automation tools in the market:
GitHub Actions is a Continuous Integration (build, test, merge) and Continuous Delivery (automatically released to the repository) (CI/CD) platform. It automates and executes the software development workflows right from GitHub.
With GitHub Actions, you can build, test, and publish across multiple platforms, operating systems, and languages all within the same workflow and then see the status checks displayed within the pull request.

All GitHub Actions are handled via workflows, which are .yml files placed under the .github/workflows directory in a repository that defines automated processes. It brings automation directly into the software development lifecycle via event-driven triggers such as creating a pull request or pushing a code into a remote branch.
With GitHub Action, the pain of keeping your plugins updated is gone (which is the issue for other CI/CD tools like Jenkins), You don’t have to go to a separate tab for running CI/CD and pushing your code. It is all done in GitHub.
Some of the features of GitHub Actions are:
At present, GitHub Actions is free to use for public repositories, and for private, it has a pay-as-you-go mechanism.
GitHub Actions lets you run workflows when a certain triggering event occurs such as a code push, or pull request. A GitHub repository can have multiple workflows. For example, we can create 1 workflow to run our test case whenever there is a code push and one workflow to test the pull requests.
As part of this Cypress with GitHub Actions tutorial, we will learn how to set up the GitHub Action pipeline whenever there is a code push to the remote branch. Reference code can be found here: 
Below are the steps to set up GitHub Actions in the Git repository:


Follow the below sample code to create a GitHub Actions workflow (.yml file)
name: Add Action
on:
push:
branches:
- main
jobs:
Cypress-Test:
runs-on: ubuntu-latest
steps:
- name: Checkout GitCode
uses: actions/checkout@v2
Now if you add this simple workflow to your repo, and push your code on the main branch, you can check that a workflow has been added under the Actions tab.

If you click on the workflow run, you’ll see some details such as the commit, the status, the time duration, as well as the jobs that have run.

As per the above screenshot, we have only 1 job, i.e., Cypress-Test. We can also view the logs about setting up the job and completing it just by clicking Cypress-Test.

If you want to explore more on the workflow syntax. You can check here.
Note: Run End-to-End Cypress tests on the cloud grid with GitHub Actions. Try TestMu AI Now!
Cypress is a test automation tool for web applications, and GitHub Actions is a service that allows developers to automate various tasks, such as building, testing, and deploying code. Using Cypress with GitHub Actions allows us to automate the testing of a web application as part of the continuous integration and continuous deployment process. This can help ensure that the application is working properly and save time and effort for the development team.
To use Cypress with GitHub Actions, you would need to create a workflow file that defines the steps for running your Cypress tests. This file would be stored in your GitHub repository and would be executed by GitHub Actions whenever a specified event, such as pushing code to the repository, occurs.
We will see step by step, how to run the tests using Cypress with GitHub Actions.
Pre-Requisites:
Test Scenario:
Below is the Cypress end-to-end test code where the user opens the browser, searches for a product, and verifies it in the end.
describe("Automation using Cypress", () => {
it("Open website and enter username, password", () => {
cy.visit(
"https://ecommerce-playground.lambdatest.io/index.php?route=account/login"
);
});
it("Login into the application using credentials", () => {
cy.get('[id="input-email"]').type("[email protected]");
cy.get('[id="input-password"]').type("Cypress123!!");
cy.get('[type="submit"]').eq(0).click();
});
it("Search the Product", () => {
cy.get('[name="search"]').eq(0).type("Macbook");
cy.get('[type="submit"]').eq(0).click();
});
it("Verify Product after search ", () => {
cy.contains("Macbook");
});
});
In order to run the above code locally through the terminal, we would run the command “npx cypress run”.
It will run the Cypress test automation and show you the test result in the terminal just like shown below:

Let’s learn how to run the above tests using Cypress with GitHub Actions. If you have followed setting up GitHub Actions in the above section of this blog on Cypress with GitHub Actions, by now you would know how to create a workflow .yml file.
Follow the below code to run the tests using Cypress with Github Actions:
name: Cypress Tests
on: [push]
jobs:
Cypress-Test:
runs-on: ubuntu-latest
steps:
- name: Checkout GitCode
uses: actions/checkout@v2
- name: Run Cypress Test
uses: cypress-io/github-action@v4
with:
command: npx cypress run
browser: chrome
In order to run it using Cypress with GitHub Actions workflow, we will use the Cypress official GitHub Actions (cypress-io/github-action@v4) (ref : Line11)




The above workflow would be called whenever there will be code push in your remote GitHub repository.
Once, the workflow is run. You can view the workflow run status from the Actions tab in your GitHub Project just as shown in the below screenshot.

You can also check the step-by-step summary of each GitHub Actions just by clicking the file name and it will take you to the summary screen.

cypress-io/[email protected] . . is the Cypress official GitHub Action. By default, it:
In the section on ‘How to run Cypress tests in Docker Container GitHub Actions,’ we’ll dive deeper into the benefits of using Docker alongside Cypress for efficient and reproducible test execution. Learn how to set up your environment for seamless Cypress docker integration.
There are multiple approaches to perform Cypress testing on a cloud testing platform like TestMu AI using GitHub Actions.
Continuous quality cloud testing platforms such as TestMu AI lets you perform manual and automation testing of your websites and mobile applications on an online device farm of 3000+ real browsers, devices, and platform combinations. It provides developers with the ability to run their automated tests using different automation testing frameworks including Selenium, Cypress, Playwright and more.
Subscribe to the TestMu AI YouTube channel for tutorials around Selenium testing, Playwright browser testing, Appium, and more.
One of the ways is using the command as part of Cypress with GitHub Actions.
Below is the Cypress end-to-end testing code, which I would run in the TestMu AI cloud platform.
describe("Automation using Cypress", () => {
it("Open website and enter username, password", () => {
cy.visit(
"https://ecommerce-playground.lambdatest.io/index.php?route=account/login"
);
});
it("Login into the application using credentials", () => {
cy.get('[id="input-email"]').type("[email protected]");
cy.get('[id="input-password"]').type("Cypress123!!");
cy.get('[type="submit"]').eq(0).click();
});
it("Search the Product", () => {
cy.get('[name="search"]').eq(0).type("Macbook");
cy.get('[type="submit"]').eq(0).click();
});
it("Verify Product after search ", () => {
cy.contains("Macbook");
});
});
To run the Cypress UI tests on the TestMu AI Platform, we need to do the configuration using 3 steps.
Step 1: Install TestMu AI CLI.
Install TestMu AI CLI using npm, use the below command:
npm install lambdatest-cypress-cli

Step 2: Set up the config.
Once the TestMu AI CLI is installed, now we need to set up the configuration using the below command:
lambdatest-cypress init

After running the command, there will be a file created in your project named “lambdatest-config.json”. We need to set up the configuration in order to run our test case on different browsers on TestMu AI.
For Cypress version 10 and above, you can follow the below code to set up lambdatest-config.json.
{
"lambdatest_auth": {
"username": "user.name",
"access_key": "access.key"
},
"browsers": [
{
"browser": "Chrome",
"platform": "Windows 10",
"versions": [
"latest-1"
]
},
{
"browser": "Firefox",
"platform": "Windows 10",
"versions": [
"latest-1"
]
}
],
"run_settings": {
"config_file": "cypress.config.js",
"reporter_config_file": "base_reporter_config.json",
"build_name": "Cypress-Test",
"parallels": 1,
"specs": "./cypress/e2e/*/*.cy.js",
"ignore_files": "",
"network": false,
"headless": false,
"npm_dependencies": {
"cypress": "11.2.0"
}
},
"tunnel_settings": {
"tunnel": false}}
Step 3: Execute Test Case
Once the config is done, now you can execute the Cypress test case on the TestMu AI cloud Platform. You just need to run the below command to run it on TestMu AI.
lambdatest-cypress run

After the command is run and test cases are executed successfully, you can view the Cypress test run on TestMu AI cloud platform (Just like shown in the screenshot below):

You can also view the logs by navigating to the logs section.

Until now, we learnt how to run Cypress automation tests on the TestMu AI cloud platform using the IDE terminal. Let’s see how to run the above flow using Cypress with GitHub Actions.
In order to run it using Cypress with GitHub Actions workflow, we will use the Cypress official GitHub Actions (cypress-io/github-action@v4), which either works on the script passed in the package.json or directly picks the cypress commands passed in the .yml file.
So, we will create a script in package.json. In order to run the Cypress test on the TestMu AI cloud platform, we need to run the command “lambdatest-cypress run”.
The same command, we will create as a script in package.json just as shown below:
{
"name": "cypress_github-actions-example",
"version": "1.0.0",
"description": "test automation using cypress",
"main": "index.js",
"scripts": {
"test": "lambdatest-cypress run"
},
"repository": {
"type": "git",
"url": "https://github.com/Anshita-Bhasin/Cypress_Github-Actions.git"
},
"author": "Anshita Bhasin",
"license": "ISC",
"devDependencies": {
"cypress": "^11.2.0"
},
"dependencies": {
"lambdatest-cypress-cli": "^3.0.7"
}}
To test if the above script is working fine, Go to the terminal and execute the command “< npm run scriptname >”
For the above code, the command would be npm run test. If you see the tests result just as shown below, that means your script is absolutely working fine.

To run the same using GitHub Actions.
Command basically runs the Cypress command to execute the Cypress tests. It will check in package.json if there is a command with the name “test” and then it will run, else it will throw an error.
After creating the workflow, you can check the Actions tab in your GitHub Repository. It will show the summary of the workflow run.

Now, navigate to the TestMu AI cloud platform to ensure whether tests are executed or not. You should be able to see the latest build on TestMu AI.

You can also run tests on different browsers using Cypress with GitHub Actions. Just provide the Cypress-supported browser name on which you want to run your test case. As part of the code below, I have passed Firefox. So, the test case would run on the Firefox browser but you can pass Chrome, Electron, or any other browser which Cypress supports.
name: Cypress Test on Firefox
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-20.04
name: E2E Test on Firefox
steps:
- uses: actions/checkout@v2
- uses: cypress-io/github-action@v4
with:
browser: firefox
Once the above workflow is executed, you can go to the Actions tab and view the logs where you should be able to see the browser name. It should be the same as passed in the workflow file. Below is the sample screenshot of the workflow logs:

You can also run the Cypress tests in your Docker Container using GitHub Actions. There is already a docker image available online with chrome version 78 and Firefox version 70 pre-installed. You can pass the container image using an argument container. After executing the test cases, it also stops the container.
Below is the sample code to run the Cypress test in the docker container using GitHub Actions:
name: Cypress Test in custom container
on: [push]
jobs:
cypress-test:
runs-on: ubuntu-20.04
name: Cypress Tests on docker container
# Cypress Docker image with Chrome v78
# and Firefox v70 pre-installed
container: cypress/browsers:node12.13.0-chrome78-ff70
steps:
- uses: actions/checkout@v2
- uses: cypress-io/github-action@v4
with:
browser: chrome
You can get the Cypress test result as an artifact after your workflow is executed. You can store the generated videos or screenshots as CI artifacts. Let’s take an example – you want videos of your test run after every run but you want screenshots only when your test fails. So, this can be done by passing conditions in the workflow. We will use GitHub Actions actions/upload-artifact@v2 for storing the artifacts and then will pass the condition to show the artifacts.
Below is the sample code.
name: Cypress Artifacts
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-latest
name: Test Artifacts
steps:
- uses: actions/checkout@v2
- uses: cypress-io/github-action@v4
- uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: ./cypress/screenshots
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: ./cypress/videos
After your workflow is executed, you can check the artifacts from the summary of the workflow.
Click on the Actions tab. Select the action for the desired workflow run. Click the workflow and it will navigate to the summary page.

Cypress is compatible with different CI tools available in the market but one of the leading ones is GitHub Actions. Cypress even has its official GitHub Action(cypress-io/[email protected]) which installs the npm dependency and runs the Cypress test. Running your Cypress test case on CI/CD platform gives you leverage to schedule it and run it on different trigger events which save a lot of time.
As part of this blog on Cypress with GitHub Actions, we covered the scenarios where we executed the Cypress test cases using GitHub Actions and also covered running it on a cloud platform.
Stay tuned for the topics on the Cypress Docker Tutorial. We delve into topics like seamless integration with Docker, optimizing container resources, and maximizing testing efficiency.
Did you find this page helpful?
More Related Hubs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance