Skip to content

Commit db1c708

Browse files
committed
[feat] Update README
1 parent ed60291 commit db1c708

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

README.md

+49-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,42 @@
1+
<div align="center">
2+
3+
<img
4+
src="./images/k6.gif"
5+
width="600"
6+
style="pointer-events: none;" />
7+
8+
<br />
9+
Open source load testing tool and SaaS for ambitious engineering teams.
10+
11+
</div>
12+
113
# run-k6-action
214
> This GitHub Action is under active development 🧑‍🏭
315
> Please, use https://github.com/grafana/k6-action instead
416
517
This action allows you to easily execute k6 tests as part of your GitHub Actions workflow.
618

7-
It is a wrapper over `k6 run`, with support for globs, parallel execution, and fail-fast.
19+
It is a wrapper over `k6 run`, with support for globs, parallel execution, fail-fast, and many other features.
820

921
> This action won't setup/install k6. That functionality is provided by [grafana/setup-k6-action](https://github.com/grafana/setup-k6-action)
1022
23+
## Inputs
24+
25+
The following inputs can be used as `step.with` key:
26+
27+
| Name | Type | Required | Description
28+
| --- | --- | --- | --- |
29+
| `path` | string | `true` | Glob pattern to select one or multiple test scripts to run. <br/> e.g. `./tests/api*.js` <br/> One can also supply multiple patterns by separating them with new line.<br/><code>path: \|<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./tests/api*.js<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./tests/app*.js</code>
30+
| `cloud-run-locally` | boolean | `false` | If `true`, the tests are executed locally and the results are uploaded to Grafana Cloud k6
31+
| `parallel` | boolean | `false` | If `true` and multiple tests are executed, all them run in parallel.
32+
| `fail-fast` | boolean | `false` | If `true`, the whole pipeline fails as soon as the first test fails
33+
| `flags` | string | `false` | Additional flags to be passed on to the `k6 run` command.<br/>e.g. `--vus 10 --duration 20s`
34+
| `cloud-comment-on-pr` | boolean | `false` | If `true`, the workflow comments a link to the cloud test run on the pull request (if present)
35+
| `only-verify-scripts` | boolean | `false` | If `true`, only check if the test scripts are valid and skip the test execution'
36+
1137
## Usage
1238

13-
See [action.yml](action.yaml).
39+
Following are some examples of using the workflow.
1440

1541
### Basic
1642

@@ -94,3 +120,24 @@ jobs:
94120
parallel: true # optional: run tests in parallel (default: false)
95121
fail-fast: false # optional: fail the step early if any test fails (default: true)
96122
```
123+
124+
Comment Grafana cloud k6 test URL on PR
125+
126+
```yaml
127+
- uses: grafana/[email protected]
128+
env:
129+
K6_CLOUD_TOKEN: ${{ secrets.K6_CLOUD_TOKEN }}
130+
K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }}
131+
with:
132+
path: |
133+
./tests/api*.js
134+
cloud-run-locally: false
135+
cloud-comment-on-pr: true
136+
```
137+
138+
<div align="center">
139+
<img
140+
src="./images/pr-comment.png"
141+
width="600"
142+
style="pointer-events: none;" />
143+
</div>

images/k6.gif

571 KB
Loading

images/pr-comment.png

134 KB
Loading

0 commit comments

Comments
 (0)