Documentationbreadcrumb arrow Learning pathsbreadcrumb arrow Automate k6 in CI/CD

Open in Grafana Cloud

Complete this learning path directly in your Grafana Cloud stack with an interactive learning experience.

Automate k6 in CI/CD pipelines

Welcome to the Grafana learning path that shows you how to automate k6 performance tests in your CI/CD pipelines. Running k6 manually gives you performance data when you think to ask for it. Automating k6 in your pipeline gives you performance data on every deploy, with the ability to block releases that don’t meet your standards.

This path guides you from a manually run k6 script to a CI/CD performance gate. You’ll verify that thresholds produce the right exit codes, parameterize your script for multiple environments, add k6 to GitHub Actions or GitLab CI, and stream results to Grafana Cloud k6. By the end, performance testing is part of the daily workflow, not a laptop-only habit.

Here’s what to expect

When you complete this path, you’ll be able to:

  • Explain what a CI/CD performance gate is and why exit codes matter
  • Verify that k6 thresholds pass and fail with the correct exit codes
  • Parameterize a script with __ENV so one script runs across environments
  • Add k6 to GitHub Actions or GitLab CI
  • Treat threshold breaches as pipeline failures that block merges or deploys
  • Stream automated test results to Grafana Cloud k6

Before you begin

Before you automate k6 in your CI/CD pipeline, ensure that you have:

Troubleshooting

If you get stuck, we’ve got your back! Where appropriate, troubleshooting information is just a click away.

More to explore

We understand you might want to explore other capabilities not strictly on this path. We’ll provide you opportunities where it makes sense.

Are you ready?