Skip to content

Commit

Permalink
Merge pull request #14 from awslabs/uploadAssetWorkflow
Browse files Browse the repository at this point in the history
ci: adding ci tools for backend repository
  • Loading branch information
ravij3 authored Feb 10, 2023
2 parents 5b7fe4c + f5e50ba commit d9967d5
Show file tree
Hide file tree
Showing 15 changed files with 271 additions and 284 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ci-checks

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v2

- name: Setup Python Version
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install Poetry Action
working-directory: backend
uses: snok/install-poetry@v1
with:
version: 1.1.13
virtualenvs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true

- name: run checks
working-directory: backend
run: make all
11 changes: 11 additions & 0 deletions backend/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
max-line-length = 88
extend-ignore = E203
exclude =
./backend/common/*
./backend/handlers/*
.git
.venv
__pycache__


1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ htmlcov/
.nox/
.coverage
.coverage.*
.coveragerc
.cache
nosetests.xml
coverage.xml
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions backend/backend/functions/assets/uploadAssetWorkflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

from typing import Any, Dict
from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext

logger = Logger()


def lambda_handler(event: Dict[str, Any], context: LambdaContext) -> None:
logger.info("Starting uploadAssetWorkflow")


def add(a: int, b: int) -> int:
return a+b
15 changes: 15 additions & 0 deletions backend/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

lint:
poetry run flake8

typecheck:
poetry run mypy .

coverage:
poetry run coverage run -m pytest
poetry run coverage report

install:
poetry install

all: install lint typecheck coverage
13 changes: 13 additions & 0 deletions backend/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[mypy]
ignore_errors = True
exclude =
.venv

[mypy-backend.functions.*]
disallow_untyped_defs = True
ignore_errors = False
ignore_missing_imports = False
disallow_any_unimported = True
no_implicit_optional = True
warn_return_any = True
warn_unused_ignores = True
Loading

0 comments on commit d9967d5

Please sign in to comment.