Cypress runs headlessly in any CI environment. The two most common setups are the official GitHub Action (which handles browser installation automatically) and the Cypress Cloud dashboard for video recording and parallel runs.
GitHub Actions Workflow
# .github/workflows/cypress.yml
name: Cypress Tests
on: [push, pull_request]
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: npm run build
start: npm start
wait-on: 'http://localhost:3000'
wait-on-timeout: 60The cypress-io/github-action handles Node setup, caching, and Chrome installation automatically.
Mochawesome HTML Reports
npm install --save-dev mochawesome mochawesome-merge mochawesome-report-generator// cypress.config.js
const { defineConfig } = require('cypress')
module.exports = defineConfig({
e2e: {
reporter: 'mochawesome',
reporterOptions: {
reportDir: 'cypress/reports',
overwrite: false,
html: false,
json: true,
},
},
})After the run, merge JSON fragments and generate HTML:
npx mochawesome-merge "cypress/reports/*.json" > merged.json
npx marge merged.json --reportDir cypress/reports/finalScreenshots and Video
Cypress captures screenshots on failure automatically. Enable video recording in config:
module.exports = defineConfig({
e2e: {
video: true,
screenshotOnRunFailure: true,
videosFolder: 'cypress/videos',
screenshotsFolder: 'cypress/screenshots',
},
})Upload artifacts in GitHub Actions:
- name: Upload screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Upload videos
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-videos
path: cypress/videosCI Pipeline Overview
Cypress CI pipeline
Ctrl+Enter
HTML
CSS
JS
Preview
Parallel Runs with Cypress Cloud
Register at cloud.cypress.io to get a project ID, then:
- name: Cypress run (parallel)
uses: cypress-io/github-action@v6
with:
record: true
parallel: true
group: 'CI'
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}Cypress Cloud splits your spec files across machines automatically — a 10-minute suite can finish in under 2 minutes with enough runners.