Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(lambda): add lint and license check for video conversion lambda #602

Merged
merged 1 commit into from
Feb 27, 2024
Merged
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
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__
Loading