diff --git a/.github/workflows b/.github/workflows new file mode 100644 index 0000000..0cb6629 --- /dev/null +++ b/.github/workflows @@ -0,0 +1,23 @@ +name: k6 Load Test + +on: + push: + branches: + - '**' + +jobs: + run-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup K6 + uses: grafana/setup-k6-action@v1 + - name: Run local k6 test + uses: grafana/run-k6-action@v1 + env: + K6_CLOUD_TOKEN: ${{ secrets.K6_CLOUD_TOKEN }} + K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }} + with: + path: test.js diff --git a/test.js b/test.js new file mode 100644 index 0000000..2f7430e --- /dev/null +++ b/test.js @@ -0,0 +1,12 @@ +import http from 'k6/http'; +import { sleep } from 'k6'; + +export const options = { + duration: '1m', + vus: 50, +}; + +export default function () { + const res = http.get('https://quickpizza.grafana.com/'); + sleep(1); +}