Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

github-action

> 测试质量
Open source

GitHub Action for running Cypress end-to-end & component tests

1.5K stars0 likes5 views
WebsiteGitHub

About

GitHub Action for running Cypress end-to-end & component tests

cypress-io/github-action [![Action status][ci-badge]][ci-workflow] [![cypress][cloud-badge]][cloud-project] [![renovate-app badge][renovate-badge]][renovate-bot]

Cypress based cypress-io/github-action runs End-to-End or Component tests in GitHub Actions Continuous Integration (CI) workflows, optionally recording to Cypress Cloud

Introduction

In addition to running Cypress tests, the action includes dependency installation, caching and more:

Function Benefits
Single-line call Simplified use by installing dependencies and running Cypress in one line of workflow code
Build app, Start server and Wait for server options Convenience of app, server and test coordination
cypress run CLI type options Improved readability with vertically listed workflow options
Dependency installation based on npm, pnpm and Yarn Classic lock files Reduced command complexity
Caching of Cypress binary and dependencies for npm and Yarn Classic installations Reduced download bandwidth requirements
Job summary Fast access to results overview
Docker compatibility Improved independence from GitHub-hosted runner image version changes. Fixed Docker environments can be used.
Recording to Cypress Cloud compatibility including parallel execution Improved interpretation of test results through Cypress Cloud
Live examples Speeds up introduction and troubleshooting
Yarn Modern usage and cache examples Extends usage beyond Yarn Classic
pnpm cache examples Reduced download bandwidth requirements for pnpm
Debug enabled Improved workflow troubleshooting
Ping utility Improved server reachability troubleshooting

The following examples demonstrate the actions' functions.

Examples

  • End-to-End testing
  • Component testing
  • Select action version
  • Run tests in a given browser
    • using Chrome
    • using Chrome for Testing
    • using Firefox
    • using Edge
    • using headed mode
  • Using Docker image
  • Specify environment variables
  • Specify expose variables
  • Run only some spec files
  • Test project in subfolder
  • Record results on Cypress Cloud
    • Getting Git information environment variables
    • Getting PR and URL automatically
    • Overwriting Merge SHA into SHA message
  • Tag recordings
  • Specify auto cancel after failures
  • Store test artifacts on GitHub
  • Quiet output
  • Set Cypress config values
  • Use specific config file
  • Run tests in parallel
  • Combine Component and E2E testing
  • Build app before running the tests
  • Start server before running the tests
  • Start multiple servers before running the tests
  • Wait for server to respond before running the tests
  • Use custom install command
  • Use command prefix
  • Use custom test command
  • Pass custom build id when recording to Cypress Cloud
  • Generate a robust custom build id to allow re-running the workflow
  • Use different working-directory
  • Use subfolders
  • Use pnpm
  • Use pnpm workspaces
  • Use Yarn Classic
  • Use Yarn Modern
  • Use Yarn Plug'n'Play
  • Use Yarn workspaces
  • Disable package manager cache
  • Use custom cache key
  • Run tests on multiple Node versions
  • Split install and tests into separate jobs
  • Split install and tests with artifacts
  • Use custom install commands
  • Use timeouts to avoid hanging CI jobs
  • Print Cypress info like detected browsers
  • Run tests nightly or on any schedule
  • Specify job summary title
  • Suppress job summary
  • More examples

Examples contained in this repository, based on current Cypress versions, can be found in the examples directory.

Live examples, such as example-basic.yml are shown together with a status badge. Click on the status badge to read the source code of the workflow, for example Note: this package assumes that cypress is declared as a development dependency in the package.json file. The cypress npm module is required to run Cypress via its Module API.

End-to-End Testing

yaml
name: End-to-end tests
on: push
jobs:
  cypress-run:
    runs-on: ubuntu-24.04
    steps:
      - name: Checkout
        uses: actions/checkout@v7
      # Install dependencies with caching
      # and run all Cypress tests
      - name: Cypress run
        uses: cypress-io/github-action@v7

The workflow file example-basic.yml shows how Cypress runs on GH Actions using Ubuntu (22.04 and 24.04), Windows, and macOS without additional OS dependencies necessary.

This workflow uses the default test type of End-to-End (E2E) Testing. Alterna

Issues· 44 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptactionscypresscypress-iogithub-actions

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category测试质量
PricingOpen source

> Related tools

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.