From 0d74063aec7de9ad1ec97818df54415a52c87850 Mon Sep 17 00:00:00 2001 From: Thuan Vo Date: Mon, 26 Feb 2024 15:54:05 -0800 Subject: [PATCH] ci(lambda): add lint and license check for video conversion lambda --- .github/workflows/lambda-lint.yaml | 22 ++++++++++++++++++- .github/workflows/license-check.yaml | 13 ++++++++++- .../lambda/requirements_dev.txt | 1 + app/video-conversion/lambda/setup.cfg | 5 +++++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 app/video-conversion/lambda/requirements_dev.txt create mode 100644 app/video-conversion/lambda/setup.cfg diff --git a/.github/workflows/lambda-lint.yaml b/.github/workflows/lambda-lint.yaml index 9c621f666..c93d08bc0 100644 --- a/.github/workflows/lambda-lint.yaml +++ b/.github/workflows/lambda-lint.yaml @@ -17,7 +17,7 @@ on: - synchronize jobs: - flake8-check: + video-processing-flake8: runs-on: ubuntu-latest steps: - name: Check out the repository @@ -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 + run: pip install -r requirements_dev.txt + - name: Run flake8 check + working-directory: app/video-conversion + run: make lint diff --git a/.github/workflows/license-check.yaml b/.github/workflows/license-check.yaml index 3809b9ffb..73ca81e7c 100644 --- a/.github/workflows/license-check.yaml +++ b/.github/workflows/license-check.yaml @@ -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 @@ -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 diff --git a/app/video-conversion/lambda/requirements_dev.txt b/app/video-conversion/lambda/requirements_dev.txt new file mode 100644 index 000000000..a1f9c377f --- /dev/null +++ b/app/video-conversion/lambda/requirements_dev.txt @@ -0,0 +1 @@ +flake8==7.0.0 diff --git a/app/video-conversion/lambda/setup.cfg b/app/video-conversion/lambda/setup.cfg new file mode 100644 index 000000000..1342141d3 --- /dev/null +++ b/app/video-conversion/lambda/setup.cfg @@ -0,0 +1,5 @@ +[flake8] +ignore = D203 +max-line-length = 200 +exclude = + __pycache__