-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (62 loc) · 2.32 KB
/
run.yml
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
name: Invoke Load Tests
on:
workflow_dispatch:
inputs:
tests:
description: >
List of test names separated by commas
Example - route_guide_unary,route_guide_client_streaming
required: false
clusterName:
description: 'Cluster name'
required: false
schedule:
- cron: '0 0 * * *'
jobs:
invokeLoadTests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Process cluster name
id: processClusterName
run: |
clusterName="${{github.event.inputs.clusterName}}"
if [ "$clusterName" = "" ]; then
clusterName="grpc-perf-cluster-test"
fi
printf "clusterName=%s" $clusterName >> $GITHUB_OUTPUT
- name: Get latest ballerina runtime artifact
id: setRuntimeUrl
shell: bash
run: |
printf "runtimeUrl=%s" $(curl -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/ballerina-platform/module-ballerina-grpc/actions/artifacts | \
jq '[.artifacts[] | select(.name=="ballerina-runtime" and .expired==false)]|max|.archive_download_url') >> $GITHUB_OUTPUT
- name: Format test names
id: formatTestNames
shell: bash
run: |
tests="${{github.event.inputs.tests}}"
if [ ! "$tests" = "" ]; then
testsInput=(${tests//,/ })
testsCount=${#testsInput[@]}
testsOutput=""
for (( i=0; i<$testsCount; i++ ));
do
echo "${testsInput[$i]}";
testsOutput+=\\'"'${testsInput[$i]}\\'"',
done
echo [${testsOutput:0:-1}]
printf "testNames=%s" [${testsOutput:0:-1}] >> $GITHUB_OUTPUT
else
printf "testNames=%s" $tests >> $GITHUB_OUTPUT
fi
- name: Invoke standard library load test workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: showTest
repo: dilanSachi/GitWorkflowTest
token: ${{ secrets.GIT_PAT }}
ref: refs/heads/main
inputs: '{ "owner": "${{ steps.formatTestNames.outputs.testNames }}", "repo": ${{ steps.setRuntimeUrl.outputs.runtimeUrl}}, "package": "${{ steps.processClusterName.outputs.clusterName }}", "version": "1231", "patch": "" }'