Skip to content

Commit 0effebc

Browse files
authored
feat!: Convert to cargo-lambda, remove database stuff (#30)
1 parent af106d1 commit 0effebc

23 files changed

+390
-6204
lines changed

.cargo/config.toml

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

.github/renovate.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base",
5+
":semanticCommits",
6+
":semanticCommitTypeAll(chore)"
7+
],
8+
"packageRules": [
9+
{
10+
"matchPackagePatterns": ["aws_lambda_events", "lambda_http", "lambda_runtime"],
11+
"groupName": "lambda"
12+
}
13+
]
14+
}

.github/workflows/checks.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on: push
2+
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- run: cargo clippy
9+
check_format:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- run: rustup toolchain install nightly
14+
- run: rustup component add rustfmt --toolchain nightly
15+
- run: cargo +nightly fmt --check --all
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- run: cargo test
21+
try_arm64_build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Install Zig toolchain
26+
uses: korandoru/setup-zig@v1
27+
with:
28+
zig-version: 0.10.0
29+
- name: Install Cargo Lambda
30+
uses: jaxxstorm/[email protected]
31+
with:
32+
repo: cargo-lambda/cargo-lambda
33+
tag: v0.14.0 # Remove this if you want to grab always the latest version
34+
platform: linux # Other valid options: 'windows' or 'darwin'
35+
arch: x86_64 # Other valid options for linux: 'aarch64'
36+
- run: cargo lambda build --arm64

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Install Zig toolchain
12+
uses: korandoru/setup-zig@v1
13+
with:
14+
zig-version: 0.10.0
15+
- name: Install Cargo Lambda
16+
uses: jaxxstorm/[email protected]
17+
with:
18+
repo: cargo-lambda/cargo-lambda
19+
tag: v0.14.0 # Remove this if you want to grab always the latest version
20+
platform: linux # Other valid options: 'windows' or 'darwin'
21+
arch: x86_64 # Other valid options for linux: 'aarch64'
22+
- run: cargo lambda build --arm64
23+
- run: cargo lambda deploy
24+
env:
25+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
26+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27+
integration_test:
28+
runs-on: ubuntu-latest
29+
needs: deploy
30+
steps:
31+
- uses: actions/checkout@v3
32+
- run: pip install awscurl
33+
- run: >-
34+
awscurl --service lambda -X POST ${{ secrets.FUNCTION_URL }} -d '{"query": "query { users {name} }"}'
35+
env:
36+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
37+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 commit comments

Comments
 (0)