build(ci): add ocpp-server code linter check
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 12 Jun 2024 18:53:41 +0000 (20:53 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 12 Jun 2024 18:53:41 +0000 (20:53 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.github/workflows/ci.yml
tests/ocpp-server/pyproject.toml

index f48baf21a7062ffe14da4386fb2bf7c42c316b5c..b83544007ee5613addda76b3096c15afa0df752d 100644 (file)
@@ -21,6 +21,29 @@ jobs:
           else
             echo "defined=false" >> $GITHUB_OUTPUT;
           fi
+  build-ocpp-server:
+    strategy:
+      matrix:
+        python:
+          - 3.12
+    runs-on: ubuntu-latest
+    defaults:
+      run:
+        working-directory: tests/ocpp-server
+    steps:
+      - uses: actions/checkout@v4
+      - name: Setup Python ${{ matrix.python }}
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ matrix.python }}
+      - name: Install Poetry
+        run: |
+          python -m pip install --upgrade pip
+          pip install poetry
+      - name: Install Dependencies
+        run: poetry install
+      - name: Lint
+        run: poetry run task lint
   build-simulator:
     needs: [check-secrets]
     strategy:
index 88c09f88e83663a9b10378c78df1667f534e78ee..d0c6d4e4115adfdb52f0b90f69e62a26ab3c6a5a 100644 (file)
@@ -18,7 +18,7 @@ flake8 = "^7"
 
 [tool.taskipy.tasks]
 format = "black . && isort ."
-lint = "flake8 ."
+lint = "black --check --diff . && isort --check --diff . && flake8 ."
 
 [tool.isort]
 profile = 'black'