Skip to content

Commit eadd110

Browse files
committed
Bring aws_lambda_events as subpackage
Signed-off-by: David Calavera <[email protected]>
1 parent e18d366 commit eadd110

File tree

173 files changed

+12445
-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

+12445
-100
lines changed

.github/actions/rust-build/action.yml

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

.github/workflows/build-events.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
matrix:
16+
toolchain:
17+
- "1.62.0" # Current MSRV
18+
- stable
19+
env:
20+
RUST_BACKTRACE: 1
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Build events
25+
uses: ./.github/actions/rust-build
26+
with:
27+
package: aws_lambda_events
28+
toolchain: ${{ matrix.toolchain}}

.github/workflows/build-extension.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
toolchain: ${{ matrix.toolchain}}
33+
34+
35+
- name: Build Extensions runtime
36+
uses: ./.github/actions/rust-build
37+
with:
38+
package: lambda-extension
39+
toolchain: ${{ matrix.toolchain}}
40+
41+
42+
- name: Check examples
43+
working-directory: examples
44+
shell: bash
45+
run: ./check-examples.sh

.github/workflows/build-runtime.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
toolchain: ${{ matrix.toolchain}}
34+
35+
- name: Build Functions runtime
36+
uses: ./.github/actions/rust-build
37+
with:
38+
package: lambda_runtime
39+
toolchain: ${{ matrix.toolchain}}
40+
41+
- name: Build HTTP layer
42+
uses: ./.github/actions/rust-build
43+
with:
44+
package: lambda_http
45+
toolchain: ${{ matrix.toolchain}}
46+
47+
- name: Check examples
48+
working-directory: examples
49+
shell: bash
50+
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)