Skip to content

Commit 1400e6f

Browse files
author
Kamil Sobol
authored
Test latest cdk deeply. (#2333)
* parameter * try this * try this * try this * try this * try this * try this * boop * does this work ? * try this * Comment. * try this * try this * this * Revert "this" This reverts commit 9493955. * this * this * this * more * try this * try this * try this * try this * try this * try this * try this * try this * try this * try this * try this * try this * try this * try this * try this * try this * comment * make node version required * fix that * fix that * try this * try this * try this * fix that * remove from canaries * that * that * that * try this
1 parent 9fee057 commit 1400e6f

File tree

19 files changed

+482
-36
lines changed

19 files changed

+482
-36
lines changed

.changeset/good-jokes-eat.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: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,36 @@ name: build_with_cache
22
description: builds the source code if cache miss and caches the result
33
inputs:
44
node-version:
5-
default: 18
5+
required: true
6+
cdk-version:
7+
required: true
68
runs:
79
using: composite
810
steps:
11+
# Validate that non-blank inputs are provided.
12+
# This is to ensure that inputs are plumbed and not defaulted accidentally in action call chains.
13+
# The 'required' input property does not assert this if value is provided at runtime.
14+
- name: Validate input
15+
shell: bash
16+
run: |
17+
if [ -z "${{ inputs.cdk-version }}" ]; then
18+
echo "CDK version must be provided"
19+
exit 1;
20+
fi
21+
if [ -z "${{ inputs.node-version }}" ]; then
22+
echo "Node version must be provided"
23+
exit 1;
24+
fi
925
- uses: ./.github/actions/install_with_cache
26+
with:
27+
node-version: ${{ inputs.node-version }}
28+
cdk-version: ${{ inputs.cdk-version }}
1029
# cache build output based on commit sha
1130
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # version 4.0.2
1231
id: build-cache
1332
with:
1433
path: '**/lib'
15-
key: ${{ github.sha }}-node${{ inputs.node-version }}
34+
key: ${{ github.sha }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
1635
enableCrossOsArchive: true
1736
# only build if cache miss
1837
- if: steps.build-cache.outputs.cache-hit != 'true'

.github/actions/install_with_cache/action.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,41 @@ name: install_with_cache
22
description: installs node_modules if cache miss and stores in the cache
33
inputs:
44
node-version:
5-
default: 18
5+
required: true
6+
cdk-version:
7+
required: true
68
runs:
79
using: composite
810
steps:
11+
# Validate that non-blank inputs are provided.
12+
# This is to ensure that inputs are plumbed and not defaulted accidentally in action call chains.
13+
# The 'required' input property does not assert this if value is provided at runtime.
14+
- name: Validate input
15+
shell: bash
16+
run: |
17+
if [ -z "${{ inputs.cdk-version }}" ]; then
18+
echo "CDK version must be provided"
19+
exit 1;
20+
fi
21+
if [ -z "${{ inputs.node-version }}" ]; then
22+
echo "Node version must be provided"
23+
exit 1;
24+
fi
925
# cache node_modules based on package-lock.json hash
1026
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # version 4.0.2
1127
id: npm-cache
1228
with:
1329
path: |
1430
node_modules
1531
packages/**/node_modules
16-
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}
32+
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
1733
# only install if cache miss
1834
- if: steps.npm-cache.outputs.cache-hit != 'true'
1935
shell: bash
20-
run: npm ci
36+
run: |
37+
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 }}
41+
npx cdk --version
42+
fi

.github/actions/restore_build_cache/action.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,35 @@ description: composes restoring node_modules and restoring build artifacts
33
inputs:
44
node-version:
55
description: node version used to configure environment with
6-
default: 18
6+
required: true
7+
cdk-version:
8+
required: true
79
runs:
810
using: composite
911
steps:
12+
# Validate that non-blank inputs are provided.
13+
# This is to ensure that inputs are plumbed and not defaulted accidentally in action call chains.
14+
# The 'required' input property does not assert this if value is provided at runtime.
15+
- name: Validate input
16+
shell: bash
17+
run: |
18+
if [ -z "${{ inputs.cdk-version }}" ]; then
19+
echo "CDK version must be provided"
20+
exit 1;
21+
fi
22+
if [ -z "${{ inputs.node-version }}" ]; then
23+
echo "Node version must be provided"
24+
exit 1;
25+
fi
1026
- uses: ./.github/actions/restore_install_cache
27+
with:
28+
node-version: ${{ inputs.node-version }}
29+
cdk-version: ${{ inputs.cdk-version }}
1130
# restore build output from cache
1231
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # version 4.0.2
1332
id: build-cache
1433
with:
1534
path: '**/lib'
16-
key: ${{ github.sha }}-node${{ inputs.node-version }}
35+
key: ${{ github.sha }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
1736
fail-on-cache-miss: true
1837
enableCrossOsArchive: true

.github/actions/restore_install_cache/action.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,32 @@ description: restores node_modules from the cache and fails if no cache entry fo
33
inputs:
44
node-version:
55
description: node version used to configure environment with
6-
default: 18
6+
required: true
7+
cdk-version:
8+
required: true
79
runs:
810
using: composite
911
steps:
12+
# Validate that non-blank inputs are provided.
13+
# This is to ensure that inputs are plumbed and not defaulted accidentally in action call chains.
14+
# The 'required' input property does not assert this if value is provided at runtime.
15+
- name: Validate input
16+
shell: bash
17+
run: |
18+
if [ -z "${{ inputs.cdk-version }}" ]; then
19+
echo "CDK version must be provided"
20+
exit 1;
21+
fi
22+
if [ -z "${{ inputs.node-version }}" ]; then
23+
echo "Node version must be provided"
24+
exit 1;
25+
fi
1026
# restore node_modules from cache
1127
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # version 4.0.2
1228
id: npm-cache
1329
with:
1430
path: |
1531
node_modules
1632
packages/**/node_modules
17-
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}
33+
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node${{ inputs.node-version }}-cdk${{ inputs.cdk-version }}
1834
fail-on-cache-miss: true

.github/actions/run_with_e2e_account/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
required: false
1010
node_version:
1111
description: node version used to configure environment with
12-
required: false
12+
required: true
1313
e2e_test_accounts:
1414
description: Serialized JSON array of strings with account numbers
1515
required: true
@@ -22,6 +22,8 @@ inputs:
2222
fresh_build:
2323
description: Whether should build from scratch
2424
default: false
25+
cdk-version:
26+
required: true
2527
runs:
2628
using: composite
2729
steps:
@@ -32,9 +34,15 @@ runs:
3234
- name: Restore Build Cache
3335
if: inputs.fresh_build != 'true'
3436
uses: ./.github/actions/restore_build_cache
37+
with:
38+
cdk-version: ${{ inputs.cdk-version }}
39+
node-version: ${{ inputs.node_version }}
3540
- name: Build With Cache
3641
if: inputs.fresh_build == 'true'
3742
uses: ./.github/actions/build_with_cache
43+
with:
44+
cdk-version: ${{ inputs.cdk-version }}
45+
node-version: ${{ inputs.node_version }}
3846
- name: Link CLI
3947
if: inputs.link_cli == 'true'
4048
shell: bash

.github/actions/setup_baseline_version/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: setup_baseline_version
22
description: Set up a baseline or "previous" version of the library for testing. Mostly useful for backwards compatibility
3+
inputs:
4+
node_version:
5+
description: node version used to configure environment with
6+
required: true
37
outputs:
48
baseline_dir:
59
description: 'Path where baseline project directory is setup'
@@ -35,6 +39,8 @@ runs:
3539
with:
3640
ref: ${{ steps.get_baseline_commit_sha.outputs.baseline_commit_sha }}
3741
- uses: ./.github/actions/setup_node
42+
with:
43+
node-version: ${{ inputs.node_version }}
3844
- name: Install and build baseline version
3945
shell: bash
4046
run: |

.github/actions/setup_node/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@ name: setup_node
44
inputs:
55
node-version:
66
description: node version used to configure environment with
7-
default: 18
7+
required: true
88
runs:
99
using: composite
1010
steps:
11+
# Validate that non-blank inputs are provided.
12+
# This is to ensure that inputs are plumbed and not defaulted accidentally in action call chains.
13+
# The 'required' input property does not assert this if value is provided at runtime.
14+
- name: Validate input
15+
shell: bash
16+
run: |
17+
if [ -z "${{ inputs.node-version }}" ]; then
18+
echo "Node version must be provided"
19+
exit 1;
20+
fi
1121
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # version 4.0.2
1222
with:
1323
node-version: ${{ inputs.node-version }}

.github/workflows/canary_checks.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # version 4.1.4
1313
- uses: ./.github/actions/setup_node
14+
with:
15+
node-version: 18
1416
- name: Install and build without lock file
1517
shell: bash
1618
run: |
@@ -46,7 +48,10 @@ jobs:
4648
uses: ./.github/actions/run_with_e2e_account
4749
with:
4850
e2e_test_accounts: ${{ vars.E2E_TEST_ACCOUNTS }}
49-
node_version: ${{ matrix.node-version }}
51+
node_version: 18
52+
# Use version from package lock. Tests projects are created outside of repository root
53+
# and are using latest CDK version.
54+
cdk-version: FROM_PACKAGE_LOCK
5055
aws_region: ${{ matrix.region }}
5156
fresh_build: true
5257
shell: bash

.github/workflows/deprecate_release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # version 4.1.4
3030
- uses: ./.github/actions/setup_node
31+
with:
32+
node-version: 18
3133
- uses: ./.github/actions/install_with_cache
34+
with:
35+
node-version: 18
36+
cdk-version: FROM_PACKAGE_LOCK
3237
deprecate_release:
3338
needs:
3439
- install
@@ -47,6 +52,11 @@ jobs:
4752
# fetch full history so that we can properly lookup past releases
4853
fetch-depth: 0
4954
- uses: ./.github/actions/setup_node
55+
with:
56+
node-version: 18
5057
- uses: ./.github/actions/restore_install_cache
58+
with:
59+
node-version: 18
60+
cdk-version: FROM_PACKAGE_LOCK
5161
- name: Deprecate release versions
5262
run: npx tsx scripts/deprecate_release.ts

0 commit comments

Comments
 (0)