Skip to content

Commit

Permalink
Bring aws_lambda_events as subpackage
Browse files Browse the repository at this point in the history
Signed-off-by: David Calavera <david.calavera@gmail.com>
  • Loading branch information
calavera committed May 5, 2023
1 parent e18d366 commit 57ffcc9
Show file tree
Hide file tree
Showing 173 changed files with 12,431 additions and 100 deletions.
63 changes: 63 additions & 0 deletions .github/actions/rust-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Rust builds"
description: "Builds, tests, and formats Rust code"
inputs:
package:
required: true
description: "the Rust package to test"

runs:
using: "composite"
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Build
shell: bash
run: cargo build --all-features --verbose --package ${{ inputs.package }}

- name: Run tests
shell: bash
run: cargo test --all-features --verbose --package ${{ inputs.package }}

- name: Run fmt check
id: cargoFmt
shell: bash
run: cargo fmt --package ${{ inputs.package }} -- --check
- name: Notify fmt check
if: failure() && steps.cargoFmt.outcome == 'failure'
uses: actions/github-script@v6
with:
script: |
const message = `👋 It looks like your code is not formatted like we expect.
Please run \`cargo fmt\` and push the code again.`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message,
});
core.setFailed('It looks like there are formatting errors');
- name: Run clippy check
id: cargoClippy
shell: bash
run: cargo clippy --package ${{ inputs.package }} --all-features -- -D warnings
- name: Notify fmt check
if: failure() && steps.cargoClippy.outcome == 'failure'
uses: actions/github-script@v6
with:
script: |
const message = `👋 It looks like your code has some linting issues.
Please run \`cargo clippy --fix\` and push the code again.`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message,
});
core.setFailed('It looks like there are linting errors');
26 changes: 26 additions & 0 deletions .github/workflows/build-events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check Lambda Events

on:
push:
paths:
- 'lambda-events/**'
pull_request:
paths:
- 'lambda-events/**'

jobs:
build:
runs-on: ubuntu-latest
strategy:
toolchain:
- "1.62.0" # Current MSRV
- stable
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3

- name: Build events
uses: ./.github/actions/rust-build
with:
package: aws_lambda_events
41 changes: 41 additions & 0 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check Lambda Runtime

on:
push:
paths:
- 'lambda-runtime-api-client/**'
- 'lambda-extension/**'

pull_request:
paths:
- 'lambda-runtime-api-client/**'
- 'lambda-extension/**'


jobs:
build-runtime:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- "1.62.0" # Current MSRV
- stable
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3

- name: Build Runtime API Client
uses: ./.github/actions/rust-build
with:
package: lambda_runtime_api_client

- name: Build Extensions runtime
uses: ./.github/actions/rust-build
with:
package: lambda-extension

- name: Check examples
working-directory: examples
shell: bash
run: ./check-examples.sh
47 changes: 47 additions & 0 deletions .github/workflows/build-runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Check Lambda Runtime

on:
push:
paths:
- 'lambda-runtime-api-client/**'
- 'lambda-runtime/**'
- 'lambda-http/**'

pull_request:
paths:
- 'lambda-runtime-api-client/**'
- 'lambda-runtime/**'
- 'lambda-http/**'

jobs:
build-runtime:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- "1.62.0" # Current MSRV
- stable
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3

- name: Build Runtime API Client
uses: ./.github/actions/rust-build
with:
package: lambda_runtime_api_client

- name: Build Functions runtime
uses: ./.github/actions/rust-build
with:
package: lambda_runtime

- name: Build HTTP layer
uses: ./.github/actions/rust-build
with:
package: lambda_http

- name: Check examples
working-directory: examples
shell: bash
run: ./check-examples.sh
93 changes: 0 additions & 93 deletions .github/workflows/build.yml

This file was deleted.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ members = [
"lambda-integration-tests",
"lambda-runtime-api-client",
"lambda-runtime",
"lambda-extension"
"lambda-extension",
"lambda-events"
]

exclude = ["examples"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This package makes it easy to run AWS Lambda Functions written in Rust. This wor
- [![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.
- [![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.
- [![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.
- [![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.
- [![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.

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

0 comments on commit 57ffcc9

Please sign in to comment.