Skip to content

Commit f498280

Browse files
authored
fix cdk checks (#2520)
* fix cdk checks * fix that * changeset * fix that * boop
1 parent cceadef commit f498280

File tree

16 files changed

+226
-110
lines changed

16 files changed

+226
-110
lines changed

.changeset/selfish-items-hang.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/actions/build_with_cache/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ description: builds the source code if cache miss and caches the result
33
inputs:
44
node-version:
55
required: true
6-
cdk-version:
6+
cdk-lib-version:
7+
required: true
8+
cdk-cli-version:
79
required: true
810
runs:
911
using: composite
@@ -14,8 +16,12 @@ runs:
1416
- name: Validate input
1517
shell: bash
1618
run: |
17-
if [ -z "${{ inputs.cdk-version }}" ]; then
18-
echo "CDK version must be provided"
19+
if [ -z "${{ inputs.cdk-lib-version }}" ]; then
20+
echo "CDK Lib version must be provided"
21+
exit 1;
22+
fi
23+
if [ -z "${{ inputs.cdk-cli-version }}" ]; then
24+
echo "CDK CLI version must be provided"
1925
exit 1;
2026
fi
2127
if [ -z "${{ inputs.node-version }}" ]; then
@@ -25,13 +31,14 @@ runs:
2531
- uses: ./.github/actions/install_with_cache
2632
with:
2733
node-version: ${{ inputs.node-version }}
28-
cdk-version: ${{ inputs.cdk-version }}
34+
cdk-lib-version: ${{ inputs.cdk-lib-version }}
35+
cdk-cli-version: ${{ inputs.cdk-cli-version }}
2936
# cache build output based on commit sha
3037
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # version 4.2.0
3138
id: build-cache
3239
with:
3340
path: '**/lib'
34-
key: ${{ github.sha }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
41+
key: ${{ github.sha }}-node${{ inputs.node-version }}-cdklib${{ inputs.cdk-lib-version }}-cdkcli${{ inputs.cdk-cli-version }}
3542
enableCrossOsArchive: true
3643
# only build if cache miss
3744
- if: steps.build-cache.outputs.cache-hit != 'true'

.github/actions/install_with_cache/action.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ description: installs node_modules if cache miss and stores in the cache
33
inputs:
44
node-version:
55
required: true
6-
cdk-version:
6+
cdk-lib-version:
7+
required: true
8+
cdk-cli-version:
79
required: true
810
runs:
911
using: composite
@@ -14,8 +16,12 @@ runs:
1416
- name: Validate input
1517
shell: bash
1618
run: |
17-
if [ -z "${{ inputs.cdk-version }}" ]; then
18-
echo "CDK version must be provided"
19+
if [ -z "${{ inputs.cdk-lib-version }}" ]; then
20+
echo "CDK Lib version must be provided"
21+
exit 1;
22+
fi
23+
if [ -z "${{ inputs.cdk-cli-version }}" ]; then
24+
echo "CDK CLI version must be provided"
1925
exit 1;
2026
fi
2127
if [ -z "${{ inputs.node-version }}" ]; then
@@ -29,14 +35,18 @@ runs:
2935
path: |
3036
node_modules
3137
packages/**/node_modules
32-
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
38+
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}-cdklib${{ inputs.cdk-lib-version }}-cdkcli${{ inputs.cdk-cli-version }}
3339
# only install if cache miss
3440
- if: steps.npm-cache.outputs.cache-hit != 'true'
3541
shell: bash
3642
run: |
3743
npm ci
38-
if [[ ${{ inputs.cdk-version }} != 'FROM_PACKAGE_LOCK' ]]; then
39-
echo "Installing CDK version ${{ inputs.cdk-version }}"
40-
npm install --no-save aws-cdk@${{ inputs.cdk-version }} aws-cdk-lib@${{ inputs.cdk-version }}
44+
if [[ ${{ inputs.cdk-lib-version }} != 'FROM_PACKAGE_LOCK' ]]; then
45+
echo "Installing CDK Lib version ${{ inputs.cdk-lib-version }}"
46+
npm install --no-save aws-cdk-lib@${{ inputs.cdk-lib-version }}
47+
fi
48+
if [[ ${{ inputs.cdk-cli-version }} != 'FROM_PACKAGE_LOCK' ]]; then
49+
echo "Installing CDK Lib version ${{ inputs.cdk-cli-version }}"
50+
npm install --no-save aws-cdk@${{ inputs.cdk-cli-version }}
4151
npx cdk --version
4252
fi

.github/actions/restore_build_cache/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ inputs:
44
node-version:
55
description: node version used to configure environment with
66
required: true
7-
cdk-version:
7+
cdk-lib-version:
8+
required: true
9+
cdk-cli-version:
810
required: true
911
runs:
1012
using: composite
@@ -15,8 +17,12 @@ runs:
1517
- name: Validate input
1618
shell: bash
1719
run: |
18-
if [ -z "${{ inputs.cdk-version }}" ]; then
19-
echo "CDK version must be provided"
20+
if [ -z "${{ inputs.cdk-lib-version }}" ]; then
21+
echo "CDK Lib version must be provided"
22+
exit 1;
23+
fi
24+
if [ -z "${{ inputs.cdk-cli-version }}" ]; then
25+
echo "CDK CLI version must be provided"
2026
exit 1;
2127
fi
2228
if [ -z "${{ inputs.node-version }}" ]; then
@@ -26,12 +32,13 @@ runs:
2632
- uses: ./.github/actions/restore_install_cache
2733
with:
2834
node-version: ${{ inputs.node-version }}
29-
cdk-version: ${{ inputs.cdk-version }}
35+
cdk-lib-version: ${{ inputs.cdk-lib-version }}
36+
cdk-cli-version: ${{ inputs.cdk-cli-version }}
3037
# restore build output from cache
3138
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # version 4.2.0
3239
id: build-cache
3340
with:
3441
path: '**/lib'
35-
key: ${{ github.sha }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
42+
key: ${{ github.sha }}-node${{ inputs.node-version }}-cdklib${{ inputs.cdk-lib-version }}-cdkcli${{ inputs.cdk-cli-version }}
3643
fail-on-cache-miss: true
3744
enableCrossOsArchive: true

.github/actions/restore_install_cache/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ inputs:
44
node-version:
55
description: node version used to configure environment with
66
required: true
7-
cdk-version:
7+
cdk-lib-version:
8+
required: true
9+
cdk-cli-version:
810
required: true
911
runs:
1012
using: composite
@@ -15,8 +17,12 @@ runs:
1517
- name: Validate input
1618
shell: bash
1719
run: |
18-
if [ -z "${{ inputs.cdk-version }}" ]; then
19-
echo "CDK version must be provided"
20+
if [ -z "${{ inputs.cdk-lib-version }}" ]; then
21+
echo "CDK Lib version must be provided"
22+
exit 1;
23+
fi
24+
if [ -z "${{ inputs.cdk-cli-version }}" ]; then
25+
echo "CDK CLI version must be provided"
2026
exit 1;
2127
fi
2228
if [ -z "${{ inputs.node-version }}" ]; then
@@ -30,5 +36,5 @@ runs:
3036
path: |
3137
node_modules
3238
packages/**/node_modules
33-
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
39+
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}-cdklib${{ inputs.cdk-lib-version }}-cdkcli${{ inputs.cdk-cli-version }}
3440
fail-on-cache-miss: true

.github/actions/run_with_e2e_account/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ inputs:
2222
fresh_build:
2323
description: Whether should build from scratch
2424
default: false
25-
cdk-version:
25+
cdk-lib-version:
26+
required: true
27+
cdk-cli-version:
2628
required: true
2729
runs:
2830
using: composite
@@ -35,13 +37,15 @@ runs:
3537
if: inputs.fresh_build != 'true'
3638
uses: ./.github/actions/restore_build_cache
3739
with:
38-
cdk-version: ${{ inputs.cdk-version }}
40+
cdk-lib-version: ${{ inputs.cdk-lib-version }}
41+
cdk-cli-version: ${{ inputs.cdk-cli-version }}
3942
node-version: ${{ inputs.node_version }}
4043
- name: Build With Cache
4144
if: inputs.fresh_build == 'true'
4245
uses: ./.github/actions/build_with_cache
4346
with:
44-
cdk-version: ${{ inputs.cdk-version }}
47+
cdk-lib-version: ${{ inputs.cdk-lib-version }}
48+
cdk-cli-version: ${{ inputs.cdk-cli-version }}
4549
node-version: ${{ inputs.node_version }}
4650
- name: Link CLI
4751
if: inputs.link_cli == 'true'

.github/workflows/canary_checks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ jobs:
5151
node_version: 18
5252
# Use version from package lock. Tests projects are created outside of repository root
5353
# and are using latest CDK version.
54-
cdk-version: FROM_PACKAGE_LOCK
54+
cdk-lib-version: FROM_PACKAGE_LOCK
55+
cdk-cli-version: FROM_PACKAGE_LOCK
5556
aws_region: ${{ matrix.region }}
5657
fresh_build: true
5758
shell: bash

.github/workflows/deprecate_release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
- uses: ./.github/actions/install_with_cache
3434
with:
3535
node-version: 18
36-
cdk-version: FROM_PACKAGE_LOCK
36+
cdk-lib-version: FROM_PACKAGE_LOCK
37+
cdk-cli-version: FROM_PACKAGE_LOCK
3738
deprecate_release:
3839
needs:
3940
- install
@@ -57,6 +58,7 @@ jobs:
5758
- uses: ./.github/actions/restore_install_cache
5859
with:
5960
node-version: 18
60-
cdk-version: FROM_PACKAGE_LOCK
61+
cdk-lib-version: FROM_PACKAGE_LOCK
62+
cdk-cli-version: FROM_PACKAGE_LOCK
6163
- name: Deprecate release versions
6264
run: npx tsx scripts/deprecate_release.ts

.github/workflows/e2e_resource_cleanup.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
- uses: ./.github/actions/install_with_cache
3030
with:
3131
node-version: 18
32-
cdk-version: FROM_PACKAGE_LOCK
32+
cdk-lib-version: FROM_PACKAGE_LOCK
33+
cdk-cli-version: FROM_PACKAGE_LOCK
3334
- name: Configure AWS Credentials
3435
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # version 4.0.2
3536
with:

0 commit comments

Comments
 (0)