Skip to content
Learn with RV – Tech Blog
Learn with RV – Tech Blog

#testautomation #qa #programming #linux #devops

  • Home
  • Who am I?
  • 1-on-1 Mentoring
  • Test Automation Incubator
  • 24 Testimonials
  • YouTube
  • LinkedIn
  • Contact
Learn with RV – Tech Blog

#testautomation #qa #programming #linux #devops

K6-CICD LOGO
May 17, 2024May 24, 2026

Integrating k6 Load Tests with GitHub Actions, GitLab CI and Azure DevOps

Nowadays, ensuring the performance and reliability of your applications is crucial. Load testing helps identify performance bottlenecks and ensures your application can handle expected traffic. One popular tool for load testing is k6, which is known for its simplicity, robustness, and seamless integration with CI/CD pipelines.

In this article you will see how to integrate k6 load tests with three major CI/CD platforms: Azure DevOps, GitHub Actions, and GitLab CI.

Prerequisite - create a basic k6 test script

In each of the following CI/CD integration examples I will be using a simple script.js file that looks like this

k6-script

Integrating k6 with GitHub Actions

  1. Create a new repository that contains the above script.js file
  2. In the project root, create the following “.github/workflows/loadtest.yml” file (notes: ‘.github’ and ‘workflows’ are folders and ‘loadtest’ is just a random file name, it can be anything)
    The loadtest.yml looks like this

3. Triggers: From now on, each and every git push (including pushing this file) will trigger the workflow and execute the k6 tests – you can see the pipelines in the GitHub repository, “Actions” area

Integrating k6 with GitLab CI

  1. Create a new repository that contains the above script.js file
  2. In the project root, create the following “.gitlab-ci.yml” file that will look like this

3. Triggers: From now on, each and every git push (including pushing this file) will trigger the workflow and execute the k6 tests – you can see the pipelines in the GitLab repository, left side menu Build > Pipelines

Integrating k6 with Azure DevOps

  1. Create a new repository that contains the above script.js file
  2. Important note: before going further, you have to install k6 plugin for AzureDevOps by accessing THIS LINK
  3. In the project root, create the following “azure-pipelines.yml” file that looks like this

3. Triggers: From now on, each and every git push (including pushing this file) will trigger the workflow and execute the k6 tests – you can see the pipelines in the AzureDevops repository, left side menu “Pipelines > Pipelines”

Conclusion

Integrating k6 load testing into your CI/CD pipelines ensures that performance testing is part of your development lifecycle, catching issues early and improving the reliability of your applications.

By following the steps outlined above, you can set up automated k6 load testing in your CI/CD pipelines, gaining insights into application performance with every code change.

Enjoyed this article? Make sure to subscribe to my YouTube Channel for more Test Automation tutorials, and follow me on LinkedIn and Twitter for regular insights.
Looking to improve your test automation skills?
I’ve created a personalized 1-on-1 Mentoring program refined to boost YOUR skills. Reach out at iamrv@razvanvancea.ro for more details and together will create a learning path adapted to your current skills and goals that you are aiming for, in a timely-efficient manner🚀

Post Views: 739

Related

Share this article:
k6 Tools

Post navigation

Previous post
Next post

Recent Posts

  • Using npm –prefix to Run Scripts from a Nested package.json
  • Unit Testing in JavaScript: Getting started with Vitest
  • Fail Fast in Playwright with maxFailures
  • Cleaner asserts in Grafana k6 load tests using expect
  • AI: What Happens When an AI’s Context Window Gets Full?

Recent Comments

  1. Paul on Web Accessibility: A step-by-step guide to Testing with pa11y
  2. Automated Tests for website Accessibility with Axe and TestCafe - Learn with RV - Tech Blog on How to generate E2E TestCafe Framework in seconds
  3. RV on Exploring Faker.js: A Powerful Tool for Generating Realistic Random Test Data
  4. Adrian Maciuc on Exploring Faker.js: A Powerful Tool for Generating Realistic Random Test Data
  5. Nick on Cypress vs Playwright vs Testcafe – which framework is faster?

Archives

  • July 2026
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • March 2025
  • February 2025
  • January 2025
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023

Categories

  • AI
  • k6
  • Linux
  • Programming
  • QA
  • Tools
  • Uncategorized
©2026 Learn with RV – Tech Blog | WordPress Theme by SuperbThemes