Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
pull_request:

jobs:
check:
name: Run check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
lint:
name: Run lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
23 changes: 16 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,26 @@ on:
- v*

env:
IMAGE_REPO: ghcr.io/${{ github.repository_owner }}/aws-lambda-rie-gateway
IMAGE_REPO: public.ecr.aws/eagletmt/aws-lambda-rie-gateway

jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'create'
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::274147449864:role/GHAAwsLambdaRieGateway
role-skip-session-tagging: 'true'

- name: Log into registry
run: aws ecr-public get-login-password --region us-east-1 | docker login -u AWS --password-stdin public.ecr.aws

- name: Pull images for caching
run: |
Expand All @@ -27,10 +39,7 @@ jobs:
docker build . --tag $IMAGE_REPO:stage-builder --target builder --cache-from $IMAGE_REPO:stage-builder
docker build . --tag $IMAGE_REPO:latest --cache-from $IMAGE_REPO:stage-builder --cache-from $IMAGE_REPO:latest

- name: Log into registry
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image to GitHub Container Registry
- name: Push image
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
Expand Down
45 changes: 45 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'aws-lambda-rie-gateway'",
"cargo": {
"args": [
"build",
"--bin=aws-lambda-rie-gateway",
"--package=aws-lambda-rie-gateway"
],
"filter": {
"name": "aws-lambda-rie-gateway",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'aws-lambda-rie-gateway'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=aws-lambda-rie-gateway",
"--package=aws-lambda-rie-gateway"
],
"filter": {
"name": "aws-lambda-rie-gateway",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
Loading