From 12abbc59d6e8f3b760dc864a1ef3d9b96b8b0e3b Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 16 Apr 2022 08:43:26 -0500 Subject: [PATCH] add lint check to workflow --- .github/workflows/pull_request.yml | 23 ++++++++++++++++++++++- frigate/test/test_yuv_region_2_rgb.py | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 6985ece9b..08a1ebbe6 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,6 +2,9 @@ name: On pull request on: pull_request +env: + DEFAULT_PYTHON: 3.9 + jobs: web_lint: name: Web - Lint @@ -45,6 +48,24 @@ jobs: run: npm run test working-directory: ./web + python_checks: + runs-on: ubuntu-latest + name: Python checks + steps: + - name: Check out the repository + uses: actions/checkout@v2.3.4 + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + uses: actions/setup-python@v2.2.2 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + - name: Install requirements + run: | + pip install pip + pip install -r requirements-dev.txt + - name: Lint + run: | + python3 -m black frigate --check + python_tests: runs-on: ubuntu-latest steps: @@ -59,4 +80,4 @@ jobs: - name: Run mypy run: docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate - name: Run tests - run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest \ No newline at end of file + run: docker run --rm --entrypoint=python3 frigate:latest -u -m unittest diff --git a/frigate/test/test_yuv_region_2_rgb.py b/frigate/test/test_yuv_region_2_rgb.py index 2ae038a75..96f421565 100644 --- a/frigate/test/test_yuv_region_2_rgb.py +++ b/frigate/test/test_yuv_region_2_rgb.py @@ -38,4 +38,4 @@ class TestYuvRegion2RGB(TestCase): if __name__ == "__main__": - main(verbosity=2) \ No newline at end of file + main(verbosity=2)