-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (55 loc) · 2.76 KB
/
pushcode.yml
File metadata and controls
58 lines (55 loc) · 2.76 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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: DevOps CI/CD
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
jobs:
test-petsample:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm link
- run: npm link simplify-openapi
- run: simplify-openapi template -i petsample
- run: sed -i '/^x-deployment-profile:/d' openapi.yaml
- run: sed -i '/^x-deployment-name/s/:.*$/:\ codegen-pets-demo/' openapi.yaml
- run: simplify-openapi -i openapi.yaml -p ${{ secrets.PROJECT_ID }} -a ${{ secrets.AWS_ACCOUNT_ID }} -o $PWD/ci-test
- run: sed -i '/^ENV_functionForPets_DEPLOYMENT_STAGE/s/=.*$/=stable/' $PWD/ci-test/.env
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: eu-west-1
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: GitHubCISession
role-duration-seconds: 1200
- run: cd $PWD/ci-test && ls
- run: cd $PWD/ci-test && npm install
- run: cd $PWD/ci-test && npm run test-units
- run: cd $PWD/ci-test && npm run stack-deploy
- run: cd $PWD/ci-test && npm run push-code
- run: cd $PWD/ci-test && npm run test-apis
- run: cd $PWD/ci-test && sed -i '/^ENV_eventFunctionForPets_DEPLOYMENT_STAGE/s/=.*$/=stable/' .env
- run: cd $PWD/ci-test && sed -i '/^ENV_functionForPeple_DEPLOYMENT_STAGE/s/=.*$/=stable/' .env
- run: cd $PWD/ci-test && sed -i '/^ENV_functionForEtrangerPets_DEPLOYMENT_STAGE/s/=.*$/=stable/' .env
- run: cd $PWD/ci-test && sed -i '/^ENV_functionForPets_DEPLOYMENT_STAGE/s/=.*$/=enforce/' .env
- run: cd $PWD/ci-test && sed -i '/^ENV_functionForPets_ENFORCEMENT_PACKAGE/s/=.*$/=function-for-pets-v10/' .env
- run: cd $PWD/ci-test && npm run push-code
- run: cd $PWD/ci-test && npm run test-apis
- run: cd $PWD/ci-test && sed -i '/^ENV_eventFunctionForPets_DEPLOYMENT_STAGE/s/=.*$/=canary/' .env
- run: cd $PWD/ci-test && sed -i '/^ENV_functionForPets_DEPLOYMENT_STAGE/s/=.*$/=canary/' .env
- run: cd $PWD/ci-test && npm run push-update
- run: cd $PWD/ci-test && npm run test-apis
- run: cd $PWD/ci-test && npm run stack-destroy