Skip to content

Commit 0cb808c

Browse files
fix: Install cdklocal for LocalStack and update CDK bootstrap commands
1 parent d532c7d commit 0cb808c

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

.github/workflows/common-test.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676
run: |
7777
npm i lambda-live-debugger@${{ inputs.version || 'latest' }}
7878
working-directory: test
79+
- name: Install cdklocal for LocalStack
80+
if: ${{ inputs.useLocalStack }}
81+
run: npm i -g cdklocal
7982
- name: Configure AWS Credentials
8083
if: ${{ !inputs.useLocalStack }}
8184
uses: aws-actions/configure-aws-credentials@v4
@@ -93,12 +96,12 @@ jobs:
9396
AWS_ENDPOINT_URL: http://localhost:4566
9497
- name: Bootstrap CDK for LocalStack
9598
if: ${{ inputs.useLocalStack }}
96-
run: npx cdk bootstrap aws://000000000000/eu-west-1 -c environment=test
99+
run: npx cdklocal bootstrap aws://000000000000/eu-west-1 -c environment=test
97100
working-directory: test/cdk-basic
98101
env:
99102
AWS_ENDPOINT_URL: http://localhost:4566
100-
# CDK_DEFAULT_REGION: eu-west-1
101103
- name: Destroy
104+
if: ${{ !inputs.useLocalStack }}
102105
run: npm run destroy
103106
working-directory: test/cdk-basic
104107
continue-on-error: true
@@ -167,6 +170,9 @@ jobs:
167170
run: |
168171
npm i lambda-live-debugger@${{ inputs.version || 'latest' }}
169172
working-directory: test
173+
- name: Install cdklocal for LocalStack
174+
if: ${{ inputs.useLocalStack }}
175+
run: npm i -g cdklocal
170176
- name: Configure AWS Credentials
171177
if: ${{ !inputs.useLocalStack }}
172178
uses: aws-actions/configure-aws-credentials@v4
@@ -184,12 +190,12 @@ jobs:
184190
AWS_ENDPOINT_URL: http://localhost:4566
185191
- name: Bootstrap CDK for LocalStack
186192
if: ${{ inputs.useLocalStack }}
187-
run: npx cdk bootstrap aws://000000000000/eu-west-1 -c environment=test
193+
run: npx cdklocal bootstrap aws://000000000000/eu-west-1 -c environment=test
188194
working-directory: test/cdk-esm
189195
env:
190196
AWS_ENDPOINT_URL: http://localhost:4566
191-
# CDK_DEFAULT_REGION: eu-west-1
192197
- name: Destroy
198+
if: ${{ !inputs.useLocalStack }}
193199
run: npm run destroy
194200
working-directory: test/cdk-esm
195201
continue-on-error: true
@@ -266,6 +272,7 @@ jobs:
266272
env:
267273
AWS_ENDPOINT_URL: http://localhost:4566
268274
- name: Destroy
275+
if: ${{ !inputs.useLocalStack }}
269276
run: npm run destroy
270277
working-directory: test/sls-basic
271278
continue-on-error: true
@@ -274,6 +281,7 @@ jobs:
274281
working-directory: test/sls-basic
275282
env:
276283
AWS_ENDPOINT_URL: ${{ inputs.useLocalStack && 'http://localhost:4566' || '' }}
284+
AWS_SDK_LOAD_CONFIG: ${{ inputs.useLocalStack && '1' || '' }}
277285
- name: Test
278286
run: npx vitest --retry 2 test/sls-basic.test.ts
279287
env:
@@ -342,6 +350,7 @@ jobs:
342350
env:
343351
AWS_ENDPOINT_URL: http://localhost:4566
344352
- name: Destroy
353+
if: ${{ !inputs.useLocalStack }}
345354
run: npm run destroy
346355
working-directory: test/sls-esbuild-cjs
347356
continue-on-error: true
@@ -350,6 +359,7 @@ jobs:
350359
working-directory: test/sls-esbuild-cjs
351360
env:
352361
AWS_ENDPOINT_URL: ${{ inputs.useLocalStack && 'http://localhost:4566' || '' }}
362+
AWS_SDK_LOAD_CONFIG: ${{ inputs.useLocalStack && '1' || '' }}
353363
- name: Test
354364
run: npx vitest --retry 2 test/sls-esbuild-cjs.test.ts
355365
env:
@@ -418,6 +428,7 @@ jobs:
418428
env:
419429
AWS_ENDPOINT_URL: http://localhost:4566
420430
- name: Destroy
431+
if: ${{ !inputs.useLocalStack }}
421432
run: npm run destroy
422433
working-directory: test/sls-esbuild-esm
423434
continue-on-error: true
@@ -426,6 +437,7 @@ jobs:
426437
working-directory: test/sls-esbuild-esm
427438
env:
428439
AWS_ENDPOINT_URL: ${{ inputs.useLocalStack && 'http://localhost:4566' || '' }}
440+
AWS_SDK_LOAD_CONFIG: ${{ inputs.useLocalStack && '1' || '' }}
429441
- name: Test
430442
run: npx vitest --retry 2 test/sls-esbuild-esm.test.ts
431443
env:
@@ -494,6 +506,7 @@ jobs:
494506
env:
495507
AWS_ENDPOINT_URL: http://localhost:4566
496508
- name: Destroy
509+
if: ${{ !inputs.useLocalStack }}
497510
run: npm run destroy
498511
working-directory: test/osls-basic
499512
continue-on-error: true
@@ -502,6 +515,7 @@ jobs:
502515
working-directory: test/osls-basic
503516
env:
504517
AWS_ENDPOINT_URL: ${{ inputs.useLocalStack && 'http://localhost:4566' || '' }}
518+
AWS_SDK_LOAD_CONFIG: ${{ inputs.useLocalStack && '1' || '' }}
505519
- name: Test
506520
run: npx vitest --retry 2 test/osls-basic.test.ts
507521
env:
@@ -570,6 +584,7 @@ jobs:
570584
env:
571585
AWS_ENDPOINT_URL: http://localhost:4566
572586
- name: Destroy
587+
if: ${{ !inputs.useLocalStack }}
573588
run: npm run destroy
574589
working-directory: test/osls-esbuild-cjs
575590
continue-on-error: true
@@ -578,6 +593,7 @@ jobs:
578593
working-directory: test/osls-esbuild-cjs
579594
env:
580595
AWS_ENDPOINT_URL: ${{ inputs.useLocalStack && 'http://localhost:4566' || '' }}
596+
AWS_SDK_LOAD_CONFIG: ${{ inputs.useLocalStack && '1' || '' }}
581597
- name: Test
582598
run: npx vitest --retry 2 test/osls-esbuild-cjs.test.ts
583599
env:
@@ -646,6 +662,7 @@ jobs:
646662
env:
647663
AWS_ENDPOINT_URL: http://localhost:4566
648664
- name: Destroy
665+
if: ${{ !inputs.useLocalStack }}
649666
run: npm run destroy
650667
working-directory: test/osls-esbuild-esm
651668
continue-on-error: true
@@ -654,6 +671,7 @@ jobs:
654671
working-directory: test/osls-esbuild-esm
655672
env:
656673
AWS_ENDPOINT_URL: ${{ inputs.useLocalStack && 'http://localhost:4566' || '' }}
674+
AWS_SDK_LOAD_CONFIG: ${{ inputs.useLocalStack && '1' || '' }}
657675
- name: Test
658676
run: npx vitest --retry 2 test/osls-esbuild-esm.test.ts
659677
env:
@@ -725,6 +743,7 @@ jobs:
725743
env:
726744
AWS_ENDPOINT_URL: http://localhost:4566
727745
- name: Destroy
746+
if: ${{ !inputs.useLocalStack }}
728747
run: npm run destroy
729748
working-directory: test/sam-basic
730749
continue-on-error: true
@@ -804,6 +823,7 @@ jobs:
804823
env:
805824
AWS_ENDPOINT_URL: http://localhost:4566
806825
- name: Destroy
826+
if: ${{ !inputs.useLocalStack }}
807827
run: npm run destroy
808828
working-directory: test/sam-alt
809829
continue-on-error: true
@@ -886,6 +906,7 @@ jobs:
886906
terraform init -backend-config="bucket=lld-terraform-basic"
887907
working-directory: test/terraform-basic
888908
- name: Destroy
909+
if: ${{ !inputs.useLocalStack }}
889910
run: npm run destroy
890911
working-directory: test/terraform-basic
891912
continue-on-error: true
@@ -968,6 +989,7 @@ jobs:
968989
tofu init -backend-config="bucket=lld-opentofu-basic"
969990
working-directory: test/opentofu-basic
970991
- name: Destroy
992+
if: ${{ !inputs.useLocalStack }}
971993
run: npm run destroy
972994
working-directory: test/opentofu-basic
973995
continue-on-error: true

0 commit comments

Comments
 (0)