Skip to content

Commit 6f32f79

Browse files
committed
feat: added sam example to workflows
1 parent 5106660 commit 6f32f79

File tree

7 files changed

+71
-38
lines changed

7 files changed

+71
-38
lines changed

.github/workflows/on-merge-to-main.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ jobs:
3434
# This installs all the dependencies of ./packages/*
3535
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
3636
run: npm ci --foreground-scripts
37-
- name: Install example packages
38-
# Since we are not managing the cdk examples with npm workspaces we install
37+
- name: Install CDK example packages
38+
# Since we are not managing the CDK examples with npm workspaces we install
3939
# the dependencies in a separate step
4040
working-directory: ./examples/cdk
41-
run: npm ci
41+
run: npm ci
42+
- name: Install SAM example packages
43+
# Since we are not managing the SAM examples with npm workspaces we install
44+
# the dependencies in a separate step
45+
working-directory: ./examples/sam
46+
run: npm ci
4247
- name: Run lint
4348
run: npm run lerna-lint
4449
- name: Run tests

.github/workflows/on-release-prod.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ jobs:
3131
# This installs all the dependencies of ./packages/*
3232
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
3333
run: npm ci --foreground-scripts
34-
- name: Install example packages
35-
# Since we are not managing the cdk examples with npm workspaces we install
34+
- name: Install CDK example packages
35+
# Since we are not managing the CDK examples with npm workspaces we install
3636
# the dependencies in a separate step
3737
working-directory: ./examples/cdk
38-
run: npm ci
38+
run: npm ci
39+
- name: Install SAM example packages
40+
# Since we are not managing the SAM examples with npm workspaces we install
41+
# the dependencies in a separate step
42+
working-directory: ./examples/sam
43+
run: npm ci
3944
- name: Run lint
4045
run: npm run lerna-lint
4146
- name: Run tests

.github/workflows/pr_lint_and_test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ jobs:
2222
# This installs all the dependencies of ./packages/*
2323
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
2424
run: npm ci --foreground-scripts
25-
- name: Install example packages
26-
# Since we are not managing the cdk examples with npm workspaces we install
25+
- name: Install CDK example packages
26+
# Since we are not managing the CDK examples with npm workspaces we install
2727
# the dependencies in a separate step
2828
working-directory: ./examples/cdk
29-
run: npm ci
29+
run: npm ci
30+
- name: Install SAM example packages
31+
# Since we are not managing the SAM examples with npm workspaces we install
32+
# the dependencies in a separate step
33+
working-directory: ./examples/sam
34+
run: npm ci
3035
- name: Run lint
3136
run: npm run lerna-lint
3237
- name: Run tests

.github/workflows/run-e2e-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ jobs:
2020
# This installs all the dependencies of ./packages/*
2121
# See https://github.com/npm/cli/issues/4475 to see why --foreground-scripts
2222
run: npm ci --foreground-scripts
23-
- name: "Install example packages"
24-
# Since we are not managing the cdk examples with npm workspaces we install
23+
- name: Install CDK example packages
24+
# Since we are not managing the CDK examples with npm workspaces we install
2525
# the dependencies in a separate step
2626
working-directory: ./examples/cdk
2727
run: npm ci
28+
- name: Install SAM example packages
29+
# Since we are not managing the SAM examples with npm workspaces we install
30+
# the dependencies in a separate step
31+
working-directory: ./examples/sam
32+
run: npm ci
2833
- name: "Test packaging"
2934
run: |
3035
npm run lerna-package

examples/cdk/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"name": "cdk-app",
33
"version": "0.8.1",
4+
"author": {
5+
"name": "Amazon Web Services",
6+
"url": "https://aws.amazon.com"
7+
},
8+
"description": "This project contains source code and supporting files for a serverless application that you can deploy with CDK.",
9+
"license": "MIT-0",
410
"bin": {
511
"cdk-app": "bin/cdk-app.js"
612
},
@@ -36,4 +42,4 @@
3642
"constructs": "^10.0.82",
3743
"source-map-support": "^0.5.16"
3844
}
39-
}
45+
}

examples/sam/package.json

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
{
2-
"name": "powertools-typescript-sam-example",
3-
"version": "1.0.0",
4-
"author": {
5-
"name": "Amazon Web Services",
6-
"url": "https://aws.amazon.com"
7-
},
8-
"description": "This project contains source code and supporting files for a serverless application that you can deploy with the [SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html). The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.",
9-
"license": "MIT",
10-
"devDependencies": {
11-
"@types/aws-lambda": "^8.10.86",
12-
"@types/node": "17.0.10",
13-
"@typescript-eslint/parser": "^5.12.1",
14-
"esbuild": "^0.14.23",
15-
"eslint": "^8.4.0",
16-
"ts-node": "^10.0.0",
17-
"typescript": "^4.1.3"
18-
},
19-
"dependencies": {
20-
"@aws-lambda-powertools/logger": "^0.7.0",
21-
"@aws-lambda-powertools/metrics": "^0.7.0",
22-
"@aws-lambda-powertools/tracer": "^0.7.0",
23-
"aws-sdk": "^2.1122.0"
24-
}
2+
"name": "powertools-typescript-sam-example",
3+
"version": "0.8.1",
4+
"author": {
5+
"name": "Amazon Web Services",
6+
"url": "https://aws.amazon.com"
7+
},
8+
"description": "This project contains source code and supporting files for a serverless application that you can deploy with the [SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html). The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.",
9+
"license": "MIT-0",
10+
"scripts": {
11+
"build": "sam build --beta-features",
12+
"test": "npm run test:unit",
13+
"package": "echo 'Not applicable'",
14+
"test:unit": "npm run build && jest",
15+
"test:e2e": "echo 'To be implemented ...'",
16+
"version": "npm install @aws-lambda-powertools/logger@0.7.0 @aws-lambda-powertools/tracer@0.7.0 @aws-lambda-powertools/metrics@0.7.0 && git add package.json"
17+
},
18+
"devDependencies": {
19+
"@types/aws-lambda": "^8.10.86",
20+
"@types/node": "17.0.31",
21+
"esbuild": "^0.14.23",
22+
"eslint": "^8.4.0",
23+
"ts-node": "^10.0.0",
24+
"typescript": "^4.1.3"
25+
},
26+
"dependencies": {
27+
"@aws-lambda-powertools/logger": "^0.7.0",
28+
"@aws-lambda-powertools/metrics": "^0.7.0",
29+
"@aws-lambda-powertools/tracer": "^0.7.0",
30+
"aws-sdk": "^2.1122.0"
2531
}
26-
32+
}

lerna.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"packages": [
33
"packages/*",
4-
"examples/cdk"
4+
"examples/cdk",
5+
"examples/sam"
56
],
67
"version": "0.8.1",
78
"npmClient": "npm",
89
"message": "chore(release): %s [skip ci]"
9-
}
10+
}

0 commit comments

Comments
 (0)