Skip to content

Commit

Permalink
Use upstream k6 setup action
Browse files Browse the repository at this point in the history
And clear out local installer
  • Loading branch information
LeoColomb committed Jul 15, 2024
1 parent f1fc42c commit 3d48769
Show file tree
Hide file tree
Showing 5 changed files with 2,564 additions and 6,580 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ Some steps are required to make them ready to run.
### GitHub Actions

#### Pre-requisites

Create a workflow `.yml` file in your repositories `.github/workflows` directory.
An [example workflow](#example-workflow) is available below.
For more information, reference the GitHub Help Documentation for
[Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).

Make sure to use the [`grafana/setup-k6-action`](https://github.com/grafana/setup-k6-action) action to install k6.

#### Inputs
See [action.yml](action.yml).
For more information on these inputs, see the [API Documentation](https://developer.github.com/v3/repos/releases/#input-2).
Expand All @@ -29,7 +32,8 @@ For more information on these inputs, see the [API Documentation](https://develo

```yaml
steps:
- uses: actions/checkout@v
- uses: actions/checkout@v4
- uses: grafana/setup-k6-action@v1
- name: Test with server-configs-test
uses: h5bp/server-configs-test@main
with:
Expand Down
12 changes: 0 additions & 12 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

const path = require('path')
const core = require('@actions/core')
const tc = require('@actions/tool-cache')
const exec = require('@actions/exec')
const { DefaultArtifactClient } = require('@actions/artifact')

Expand Down Expand Up @@ -50,17 +49,6 @@ async function action () {

// ------
core.startGroup('Preparing server-configs-test')
const k6Version = core.getInput('k6-version', { required: true })
// ---
core.debug(`Download k6 v${k6Version}`)
let k6Path = tc.find('k6', k6Version)
if (!k6Path) {
const k6Download = await tc.downloadTool(`https://github.com/grafana/k6/releases/download/v${k6Version}/k6-v${k6Version}-linux-amd64.tar.gz`)
const k6ExtractedFolder = await tc.extractTar(k6Download)
const k6Root = path.join(k6ExtractedFolder, `k6-v${k6Version}-linux-amd64`)
k6Path = await tc.cacheDir(k6Root, 'k6', k6Version)
}
core.addPath(k6Path)
// ---
core.debug('Build k6 arguments')
const k6Args = ['run']
Expand Down
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ branding:
color: orange
icon: check-circle
inputs:
k6-version:
description: "The k6 version to use (default: 0.50.0)"
required: false
default: "0.50.0"
command:
description: The server-configs-test command to run (test or benchmark)
required: false
Expand Down
Loading

0 comments on commit 3d48769

Please sign in to comment.