/
neoload-github-actions-demo.yml
61 lines (52 loc) · 2.05 KB
/
neoload-github-actions-demo.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
name: NeoLoad Github Action Test
on:
workflow_dispatch:
inputs:
api_url:
required: true
description: 'NeoLoad Web Api Url'
default: 'https://neoload-api.saas.neotys.com/'
token:
required: true
description: 'NeoLoad Web Token'
default: 'specify_token_or_get_it_from_credentials'
zone_id:
required: true
description: 'Zone identifier'
default: 'defaultzone'
jobs:
neoload_cli_demo:
name: NeoLoad CLI demo github action
runs-on: ubuntu-latest
steps:
- name: Checkout local code
uses: actions/checkout@v3
- name: "Install NeoLoad CLI"
run: pip3 install -U neoload
- name: "Get NeoLoad project"
run: >
rm -f *.yml;
wget https://raw.githubusercontent.com/Neotys-Labs/neoload-cli/master/tests/neoload_projects/simpledemo.yml
- name: "Prepare NeoLoad test"
run: >
neoload login --url ${{ github.event.inputs.api_url }} ${{ github.event.inputs.token }} \
test-settings --zone ${{ github.event.inputs.zone_id }} --scenario 'simpledemo' createorpatch "My Github Test With CLI" \
project --path simpledemo.yml upload
- name: "NeoLoad run test"
run: >
neoload run
--external-url $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
--external-url-label "Github Action Run $GITHUB_RUN_NUMBER"
--name "Github pipeline performance regression test - Github build #$GITHUB_RUN_NUMBER"
--description "Example of CI performance regression job started from Github."
--return-0
- name: "Generate Test Report"
id: report
if: ${{ always() }}
run: neoload test-results junitsla
- name: "Publish Test Report"
if: steps.report.outcome == 'success'
uses: scacap/action-surefire-report@v1
with:
report_paths: junit-sla.xml
fail_on_test_failures: true