For now, only agents on Ubuntu 20.04 and 22.04 are supported.
1. Setup the
First, you need to get your CodSpeed Token. There are multiple ways to retrieve it:
- Once you enable a repository on CodSpeed, you'll be prompted to copy the token
- You can also find it on the repository settings page
Be mindful that a token is scoped to a specific repository. Make sure that you are on the correct repository settings page when copying the token.
Then, create a new pipeline secret with your preferred method
with the name
CODSPEED_TOKEN and the value of your token.
2. Install the
codspeed-runner CLI in your agent
Install the CLI on your agent by running the following commands:
CODSPEED_RUNNER_VERSION=<insert-version> # refer to https://github.com/CodSpeedHQ/runner/releases for available versions
curl -fsSL https://github.com/CodSpeedHQ/runner/releases/download/$CODSPEED_RUNNER_VERSION/codspeed-runner-installer.sh | bash
It is important to source the
$HOME/.cargo/env file to make sure that the
codspeed-runner command will be available in the pipeline.
Refer to the releases page to see all available versions.
3. Create the benchmarks pipeline
In a new or existing pipeline, add a step that will run your benchmarks with
- label: "Run benchmarks with CodSpeed"
... # your build commands
codspeed-runner --token=$CODSPEED_TOKEN -- <Insert your benchmark command here>
3. Check the results
Once the workflow is created, your pull requests will receive a performance report comment and will also receive some additional checks:
Now that everything is up and running (and hopefully green 🎉), you can start enhancing your workflow to get the most out of CodSpeed.