-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (66 loc) · 2.56 KB
/
serverless-artillery-tests.yaml
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
name: Serverless Artillery Tests
on:
push:
branches:
- development
jobs:
serverless_tests:
name: Serverless Artillery Tests
runs-on: ubuntu-latest
continue-on-error: true
strategy:
max-parallel: 1
matrix:
file:
- ../../testing/serverless-artillery/serverless-artillery-users.yml
- ../../testing/serverless-artillery/serverless-artillery-users-id.yml
- ../../testing/serverless-artillery/serverless-artillery-users-id-tasks.yml
- ../../testing/serverless-artillery/serverless-artillery-users-id-tasks-id.yml
NPM_CONFIG_PREFIX: "~/.npm-global"
STAGE_NAME: merge-perf-test1
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
check-latest: true
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Install serverless and serverless-artillery
run: |
npm install -g [email protected] serverless-artillery
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M-%S')"
- name: Deploy functions
run: ~/.npm-global/bin/slsart deploy --stage $STAGE_NAME --region us-west-2
- name: Sleep1
run: sleep 10s
- name: Invoke functions
run: ~/.npm-global/bin/slsart invoke -o ${{ matrix.file }} --stage $STAGE_NAME --region us-west-2
- name: Sleep2
run: sleep 10s
- name: Remove functions
run: ~/.npm-global/bin/slsart remove --stage $STAGE_NAME
#Azure Login
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_SP_CREDENTIALS }}
#Upload File
- name: uploading to Azure Blob Storage
uses: azure/CLI@v1
with:
azcliversion: 2.19.1
inlineScript: |
az storage blob upload --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --container-name ${{ secrets.BLOB_CONTAINER_SERVERLESS_ARTILLERY }} --name serverless-users-id-artilleryReport_${{ steps.date.outputs.date }}.json --file artilleryReport_${{ steps.date.outputs.date }}.json
# Azure logout
- name: logout
run: |
az logout