Skip to main content

Integrate Percy with CI/CD Tools

Learn how to integrate Percy with a variety of available CI/CD tools

Percy works best when integrated into your CI workflow, running continuously alongside your test suite. Percy integrates with all common CI providers and can be configured for custom environments.

Supported CI integrations

You can integrate Percy with the following CI services:

Click each CI service to see step-by-step integration instructions.

Protip
Don’t see your CI service? We’re constantly adding support for CI services. Reach out to support to see if yours is on the way.

How it works

Percy is designed to integrate with your tests and CI environment to run continuous visual reviews. After you add Percy to your tests and your CI environment, Percy starts receiving and rendering screenshots every time a CI build runs.

Configure CI environment variables

To enable Percy, configure the environment variable, ‘PERCY_TOKEN’, in your CI service. This is our write-only API token unique for each Percy project and should be kept secret.

You can find PERCY_TOKEN in your project settings.

Project settings - Environment Variables

Start and stop Percy CLI

There are two ways to start and stop Percy CLI from your CI setup:

Percy execution command

Add the percy exec command in your configuration file (for example, make file, package.json, or req.txt) to start Percy, as shown below:

Copy icon Copy snippet
Copy icon Copy snippet

In your pipeline script, make changes similar to the following:

YAML
Copy icon Copy snippet

Percy start and stop commands

If you cannot use the percy exec command in your configuration file, use the percy exec:start and percy exec:stop commands.

In this case, your configuration file looks as follows:

Copy icon Copy snippet
Copy icon Copy snippet

And your pipeline script should be similar to the following:

YAML
Copy icon Copy snippet

The above script performs the following actions:

  1. Install Percy CLI.
  2. Start Percy CLI with PERCY_TOKEN.
  3. Run your tests.
  4. Stop Percy CLI.

Parallel test suites

Percy automatically supports most parallelized test environments. Snapshots are pushed from your tests to Percy and rendered for you to review in the same Percy build, no matter if your tests are run in different processes or even on different machines. You can also simply configure Percy to support complex parallelization setups.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy