Run k6 for all branches prefixed with k6/
, i.e. k6/my-test
Last active
September 15, 2019 18:38
-
-
Save phstc/ad95318ed1cedf979c8194dc018d0ce9 to your computer and use it in GitHub Desktop.
K6 GitHub action
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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