Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Cypress io Cypress Install Start CI

From Leeroopedia
Knowledge Sources
Domains CI_CD, Package_Management
Last Updated 2026-02-12 00:00 GMT

Overview

Concrete tool for installing and caching the Cypress binary in CI environments provided by the CLI install module.

Description

The same install.start function from cli/lib/tasks/install.ts (L195-369) is used in CI, but with CI-specific environment variables. The function checks CYPRESS_CACHE_FOLDER for custom cache locations and uses downloadAndUnzip (L81-144) for binary acquisition when the cache is cold.

Usage

Invoked automatically during npm install or yarn install in CI pipelines. Configure cache directories and version pinning via environment variables.

Code Reference

Source Location

  • Repository: cypress-io/cypress
  • File: cli/lib/tasks/install.ts
  • Lines: L195-369 (install.start), L81-144 (downloadAndUnzip)

Signature

const start = async (options: any = {}): Promise<any>
// Same function as standard install, CI-specific via env vars:
// CYPRESS_CACHE_FOLDER - custom cache directory
// CYPRESS_INSTALL_BINARY - version override or "0" to skip

Import

// Triggered via npm postinstall in CI
// Or: npx cypress install

I/O Contract

Inputs

Name Type Required Description
CYPRESS_CACHE_FOLDER env var No Custom cache directory for CI persistence
CYPRESS_INSTALL_BINARY env var No Version override or "0" to skip
options.force boolean No Force reinstall (invalidate cache)

Outputs

Name Type Description
Cached binary Files Binary at CYPRESS_CACHE_FOLDER/<version>/
Verification Promise Installation verified

Usage Examples

CircleCI Cache Configuration

# .circleci/config.yml
steps:
  - restore_cache:
      keys:
        - cypress-{{ checksum "package-lock.json" }}
  - run: npm ci
  - save_cache:
      key: cypress-{{ checksum "package-lock.json" }}
      paths:
        - ~/.cache/Cypress

GitHub Actions

- uses: actions/cache@v3
  with:
    path: ~/.cache/Cypress
    key: cypress-${{ hashFiles('package-lock.json') }}
- run: npm ci

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment