Skip to content

Commit db6bac3

Browse files
committed
Bring aws_lambda_events as subpackage
Signed-off-by: David Calavera <david.calavera@gmail.com>
1 parent e18d366 commit db6bac3

File tree

173 files changed

+12428
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+12428
-100
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Rust builds"
2+
description: "Builds, tests, and formats Rust code"
3+
inputs:
4+
package:
5+
required: true
6+
description: "the Rust package to test"
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- uses: dtolnay/rust-toolchain@stable
12+
- uses: Swatinem/rust-cache@v2
13+
14+
- name: Build
15+
shell: bash
16+
run: cargo build --all-features --verbose --package ${{ inputs.package }}
17+
18+
- name: Run tests
19+
shell: bash
20+
run: cargo test --all-features --verbose --package ${{ inputs.package }}
21+
22+
- name: Run fmt check
23+
id: cargoFmt
24+
shell: bash
25+
run: cargo fmt --package ${{ inputs.package }} -- --check
26+
- name: Notify fmt check
27+
if: failure() && steps.cargoFmt.outcome == 'failure'
28+
uses: actions/github-script@v6
29+
with:
30+
script: |
31+
const message = `👋 It looks like your code is not formatted like we expect.
32+
33+
Please run \`cargo fmt\` and push the code again.`;
34+
35+
await github.rest.issues.createComment({
36+
issue_number: context.issue.number,
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
body: message,
40+
});
41+
42+
- name: Run clippy check
43+
id: cargoClippy
44+
shell: bash
45+
run: cargo clippy --package ${{ inputs.package }} --all-features -- -D warnings
46+
- name: Notify fmt check
47+
if: failure() && steps.cargoClippy.outcome == 'failure'
48+
uses: actions/github-script@v6
49+
with:
50+
script: |
51+
const message = `👋 It looks like your code has some linting issues.
52+
53+
Please run \`cargo clippy --fix\` and push the code again.`;
54+
55+
await github.rest.issues.createComment({
56+
issue_number: context.issue.number,
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
body: message,
60+
});

.github/workflows/build-events.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check Lambda Events
2+
3+
on:
4+
push:
5+
paths:
6+
- 'lambda-events/**'
7+
pull_request:
8+
paths:
9+
- 'lambda-events/**'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
toolchain:
16+
- "1.62.0" # Current MSRV
17+
- stable
18+
env:
19+
RUST_BACKTRACE: 1
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Build events
24+
uses: ./.github/actions/rust-build
25+
with:
26+
package: aws_lambda_events
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Check Lambda Runtime
2+
3+
on:
4+
push:
5+
paths:
6+
- 'lambda-runtime-api-client/**'
7+
- 'lambda-extension/**'
8+
9+
pull_request:
10+
paths:
11+
- 'lambda-runtime-api-client/**'
12+
- 'lambda-extension/**'
13+
14+
15+
jobs:
16+
build-runtime:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
toolchain:
21+
- "1.62.0" # Current MSRV
22+
- stable
23+
env:
24+
RUST_BACKTRACE: 1
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- name: Build Runtime API Client
29+
uses: ./.github/actions/rust-build
30+
with:
31+
package: lambda_runtime_api_client
32+
33+
- name: Build Extensions runtime
34+
uses: ./.github/actions/rust-build
35+
with:
36+
package: lambda-extension
37+
38+
- name: Check examples
39+
working-directory: examples
40+
shell: bash
41+
run: ./check-examples.sh
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check Lambda Runtime
2+
3+
on:
4+
push:
5+
paths:
6+
- 'lambda-runtime-api-client/**'
7+
- 'lambda-runtime/**'
8+
- 'lambda-http/**'
9+
10+
pull_request:
11+
paths:
12+
- 'lambda-runtime-api-client/**'
13+
- 'lambda-runtime/**'
14+
- 'lambda-http/**'
15+
16+
jobs:
17+
build-runtime:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
toolchain:
22+
- "1.62.0" # Current MSRV
23+
- stable
24+
env:
25+
RUST_BACKTRACE: 1
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- name: Build Runtime API Client
30+
uses: ./.github/actions/rust-build
31+
with:
32+
package: lambda_runtime_api_client
33+
34+
- name: Build Functions runtime
35+
uses: ./.github/actions/rust-build
36+
with:
37+
package: lambda_runtime
38+
39+
- name: Build HTTP layer
40+
uses: ./.github/actions/rust-build
41+
with:
42+
package: lambda_http
43+
44+
- name: Check examples
45+
working-directory: examples
46+
shell: bash
47+
run: ./check-examples.sh

.github/workflows/build.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ members = [
44
"lambda-integration-tests",
55
"lambda-runtime-api-client",
66
"lambda-runtime",
7-
"lambda-extension"
7+
"lambda-extension",
8+
"lambda-events"
89
]
910

1011
exclude = ["examples"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This package makes it easy to run AWS Lambda Functions written in Rust. This wor
77
- [![Docs](https://docs.rs/lambda_runtime/badge.svg)](https://docs.rs/lambda_runtime) **`lambda-runtime`** is a library that provides a Lambda runtime for applications written in Rust.
88
- [![Docs](https://docs.rs/lambda_http/badge.svg)](https://docs.rs/lambda_http) **`lambda-http`** is a library that makes it easy to write API Gateway proxy event focused Lambda functions in Rust.
99
- [![Docs](https://docs.rs/lambda-extension/badge.svg)](https://docs.rs/lambda-extension) **`lambda-extension`** is a library that makes it easy to write Lambda Runtime Extensions in Rust.
10+
- [![Docs](https://docs.rs/aws_lambda_events/badge.svg)](https://docs.rs/aws_lambda_events) **`lambda-events`** is a library with strongly-typed Lambda event structs in Rust.
1011
- [![Docs](https://docs.rs/lambda_runtime_api_client/badge.svg)](https://docs.rs/lambda_runtime_api_client) **`lambda-runtime-api-client`** is a shared library between the lambda runtime and lambda extension libraries that includes a common API client to talk with the AWS Lambda Runtime API.
1112

1213
The Rust runtime client is an experimental package. It is subject to change and intended only for evaluation purposes.

0 commit comments

Comments
 (0)