Skip to content

RentTheRunway/setup-k6-action

 
 

Repository files navigation


Open source performance testing tool and SaaS for ambitious engineering teams.

setup-k6-action

This action sets up a Grafana k6 environment for use in a GitHub Actions workflow by:

  • Installing a specific version of k6.
  • Installing Chrome for Browser Testing (optional).

After that we can use the run-k6-action to execute the k6 tests in the GitHub Actions workflow.

Inputs

The following inputs can be used as step.with key:

Name Type Required Description
k6-version string false Specify the k6 version to use. e.g. '0.49.0'. If not set, latest K6 version will be used.
browser boolean false Default false. If set to true chrome is also installed along with K6 for Browser testing.

Usage

Following are some examples of using the workflow.

Basic

Uses the latest k6 version

on:
  push:

jobs:
  protocol:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: grafana/setup-k6-action@v1
      - uses: grafana/run-k6-action@v1
        with:
          path: |
            ./tests/api*.js

Specify which k6 version to use

on:
  push:

jobs:
  protocol:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: grafana/setup-k6-action@v1
        with:
          k6-version: '0.49.0'
      - uses: grafana/run-k6-action@v1
        with:
          path: |
            ./tests/api*.js

Browser Testing

on:
  push:

jobs:
  protocol:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: grafana/setup-k6-action@v1
        with:
          k6-version: '0.49.0'
          browser: true
      - uses: grafana/run-k6-action@v1
        with:
          path: |
            ./tests/api*.js

About

GitHub Action for installing Grafana k6

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 94.2%
  • JavaScript 5.8%