From ffccbf2287d74bfde06179427a1eabad986d1235 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 12 Jun 2024 20:53:41 +0200 Subject: [PATCH] build(ci): add ocpp-server code linter check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ tests/ocpp-server/pyproject.toml | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f48baf21..b8354400 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/tests/ocpp-server/pyproject.toml b/tests/ocpp-server/pyproject.toml index 88c09f88..d0c6d4e4 100644 --- a/tests/ocpp-server/pyproject.toml +++ b/tests/ocpp-server/pyproject.toml @@ -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' -- 2.34.1