Skip to content

Commit

Permalink
ci(lambda): add lint and license check for video conversion lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Feb 26, 2024
1 parent 4e01020 commit be1e2c0
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 3 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/lambda-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Video Processing Lambda Format Check
name: Lambda Format Check

concurrency:
group: ${{ github.run_id }}
Expand All @@ -17,7 +17,7 @@ on:
- synchronize

jobs:
flake8-check:
video-processing-flake8:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
Expand All @@ -36,3 +36,23 @@ jobs:
- name: Run flake8 check
working-directory: app/video-processing
run: make lint

video-conversion-flake8:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: "**/requirements*.txt"
- name: Install dependencies
working-directory: app/video-conversion/lambda
run: pip install -r requirements_dev.txt
- name: Run flake8 check
working-directory: app/video-conversion
run: make lint
13 changes: 12 additions & 1 deletion .github/workflows/license-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
working-directory: app/web
run: npm run license:check

lambda-license:
video-processing-lambda-license:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
Expand All @@ -48,3 +48,14 @@ jobs:
- name: Check license headers
working-directory: app/video-processing
run: make check-license

video-conversion-lambda-license:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Check license headers
working-directory: app/video-conversion
run: make check-license
14 changes: 14 additions & 0 deletions app/video-conversion/lambda/lambda.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright [2023] [Privacypal Authors]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import urllib
import boto3
import subprocess as sp
Expand Down
1 change: 1 addition & 0 deletions app/video-conversion/lambda/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flake8==7.0.0
5 changes: 5 additions & 0 deletions app/video-conversion/lambda/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = D203
max-line-length = 200
exclude =
__pycache__

0 comments on commit be1e2c0

Please sign in to comment.