Covered in this doc
Integrating Percy with your CircleCI environment
Configuring your CircleCI Orb for parallelized builds
In your CircleCI project, go to Project settings > Environment Variables.
PERCY_TOKEN to the write-only token from your Percy project. This token can be found in your Percy project's settings.
A different way is to add the environment variables to your
circle.yml. See the CircleCI: Using Environment Variables docs for more info.
Keep your Percy token secret
Anyone with access to your token can add builds to your project, though they cannot read data.
If your code is public, do not add the
PERCY_TOKEN to your code and use the above environment setup instead.
The CircleCI orb is only for parallel builds
You will only need to use the CircleCI orb if you're running multiple Percy builds in CI
CircleCI Orbs require CircleCI configuration version 2.1 or higher.
PERCY_PARALLEL_TOTAL: this must be set to
-1. This tells Percy we don't know how parallelized this run is, but we'll consider your Percy build fully wrapped up when we hear the
percy/finalize_allcommand from the Orb.
PERCY_TOKEN: This is the token obtained from your project settings in Percy.
There are a number of different ways you can set these environment variables to be available on each step. See CircleCI's Environment Variable Usage Options documentation for more information.
Your CircleCI workflow configuration at a high level should look like this:
version2.1 orbs percypercy/[email protected] jobs run_tests parallelism3 steps attach_workspace at. runecho "your tests run here" workflows test jobs run_tests percy/finalize_all requires run_tests
We first import the
percy/agent orb and then once all tests have finished, execute
percy/finalize_all command from the Orb. Make sure you use the latest version of the orb from CircleCI's registry.
Here's a sample of what this looks like integrated into the percy-web project:
We teamed up with the CircleCI team for a live demo of our integrated workflow. Watch the recording of the session below to learn more about our CircleCI orb, and see a live visual testing demo.
Updated 4 months ago