-
Notifications
You must be signed in to change notification settings - Fork 17
97 lines (80 loc) · 2.87 KB
/
integrations.node.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
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
96
97
name: Regression Tests (NodeJS)
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
upstream-version:
description: Upstream aws-cdk version to use in tests
required: false
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
jobs:
integration-nodejs:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { language: javascript, node-version: '18.x', region: us-east-1}
- { language: typescript, node-version: '20.x', region: eu-west-2}
- { language: typescript, node-version: '21.x', region: us-east-1}
- { language: typescript, node-version: '22.x', region: us-east-1}
env:
AWS_REGION: ${{ matrix.region }}
AWS_DEFAULT_REGION: ${{ matrix.region }}
steps:
- uses: actions/checkout@v2
with:
path: repo
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies for aws-cdk-local
working-directory: repo
run: |
npm install
npm install aws-cdk
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Install specific aws-cdk version
working-directory: repo
if: inputs.upstream-version
run: npm install aws-cdk@${{ inputs.upstream-version }}
- name: Verify specific aws-cdk version is used by cdklocal
if: inputs.upstream-version
run: |
[[ $(cdklocal --version) =~ ^${{ inputs.upstream-version }}.* ]] || exit 1
- name: Install localstack CLI
run: pip install localstack
- name: Create temporary directory for test
run: mkdir cdk-test
- name: Initialize new CDK app
working-directory: cdk-test
run: cdklocal init app --language=${{ matrix.language }}
- name: Start and wait for localstack (Community)
timeout-minutes: 10
run: |
docker pull localstack/localstack:latest
localstack start -d
localstack wait -t 30
- name: Run bootstrap
working-directory: cdk-test
timeout-minutes: 1
run: cdklocal bootstrap
- name: Deploy
working-directory: cdk-test
timeout-minutes: 1
run: cdklocal deploy --require-approval=never
- name: Verify successful deployment
run: |
[ $(aws cloudformation describe-stacks --endpoint-url http://localhost:4566 | jq '[ .Stacks[] | select(.StackStatus == "CREATE_COMPLETE") ] | length') -eq 2 ] || exit 1
[ $(aws cloudformation describe-stacks --endpoint-url http://localhost:4566 | jq '[ .Stacks[] | select(.StackStatus == "CREATE_FAILED") ] | length') -eq 0 ] || exit 1