-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
95 lines (83 loc) · 3.43 KB
/
action.yml
File metadata and controls
95 lines (83 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Setup K6 Performance Testing
description: Downloads and installs k6 at the specified version and configures OS with k6 optimized settings for stress testing.
inputs:
version:
description: 'The version of k6 to install. Do not include the `v` in the prefix. At this time only versions 0.32.0 and higher will work with this action.'
required: true
architecture:
description: 'Target operating system architecture for K6 to use. Examples: arm64, amd64. Will use system architecture by default.'
required: false
default: 'amd64'
extension-token:
description: 'Github PAT token that has access to releases of k6 extension repository'
required: false
extension-asset-name:
description: 'k6 extension archive File name to download in the Release'
required: false
default: 'none'
extension-tag-name:
description: 'Release tag to download k6 extension archive'
required: false
extension-repository:
description: 'Repository that contains the k6 extension archive.'
required: false
runs:
using: composite
steps:
- name: 'Download K6 and Install'
if: inputs.extension-asset-name == 'none'
shell: bash
working-directory: '${{ github.action_path }}'
env:
VERSION: ${{ inputs.version }}
ARCH: ${{ inputs.architecture }}
run: |
# Download K6 and Install
node ./dist/index.js
- name: Download K6 with extensions
id: download
if: inputs.extension-asset-name != 'none'
uses: im-open/download-release-asset@v1.2.0
with:
github-token: ${{ inputs.extension-token }}
asset-name: ${{ inputs.extension-asset-name }}
tag-name: ${{ inputs.extension-tag-name }}
repository: ${{ inputs.extension-repository }}
- name: Install K6 Extension in Tools Cache
if: inputs.extension-asset-name != 'none'
id: download-dir
shell: bash
run: |
# Install K6 Extension in Tools Cache
download_asset="${{ steps.download.outputs.download-file-path }}"
tools_cache_k6_dir="${{ runner.tool_cache }}/k6/${{ inputs.extension-tag-name }}"
echo "Extracting K6 Extension ($download_asset) to $tools_cache_k6_dir"
mkdir -p $tools_cache_k6_dir
tar -xvzf $download_asset -C $tools_cache_k6_dir --strip-components 1
echo "$tools_cache_k6_dir" >> $GITHUB_PATH
export PATH="$PATH:$tools_cache_k6_dir"
# BEGIN: Comment out for troubleshooting
# echo "Validating Path is updated."
# echo "GITHUB_PATH:"
# echo $GITHUB_PATH
# echo ""
# echo "PATH Variable"
# echo $PATH
# echo "Listing K6 Tools Cache Directory"
# ls -la $tools_cache_k6_dir
# END: Comment out for troubleshooting
echo "Validating K6 is in path"
k6 version
- name: Tune OS
shell: bash
run: |
# Tune OS
echo "Optimizing OS for Stress Test"
sudo cp -fr /etc/security/limits.conf /etc/security/limits.conf.bk
sudo sed -i "s/65536/1048576/" /etc/security/limits.conf
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
sudo sysctl -w net.ipv4.ip_local_port_range="16384 65000"
sudo sysctl -w fs.file-max=1048576
sudo sysctl -p
echo "Updated open file limit setting, reuse TCP port setting, and port range setting below:"
sudo sysctl -a | grep -E 'net.ipv4.ip_local_port_range|net.ipv4.tcp_tw_reuse|fs.file-max'