Skip to content

Instantly share code, notes, and snippets.

@phstc phstc/README.md
Last active Sep 15, 2019

Embed
What would you like to do?
K6 GitHub action

Run k6 for all branches prefixed with k6/, i.e. k6/my-test

# .github/workflows/k6.yml
name: k6
on:
push:
branches:
- 'k6/*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run k6
run: docker run -i loadimpact/k6 run --env AUTH_TOKEN=${{ secrets.AUTH_TOKEN }} - <./script.js
import http from "k6/http";
import { check } from "k6";
export const options = {
vus: 1,
duration: "10s"
};
export default function() {
const res = http.get("http://test.loadimpact.com");
check(res, { "status was 200": r => r.status == 200 })
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.