Skip to content

Commit e5d555d

Browse files
authored
ci: add code quality workflow (#46)
* ci: add code quality workflow * fix: isort test_markup.py
1 parent d9da83c commit e5d555d

File tree

4 files changed

+87
-2
lines changed

4 files changed

+87
-2
lines changed

.github/workflows/main.yml

+57
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,60 @@ jobs:
219219
./report/**/*.xml
220220
event_name: ${{ github.event.workflow_run.event }}
221221
report_individual_runs: "true"
222+
223+
codestyle_all_without_ruff:
224+
runs-on: [self-hosted, linux, light]
225+
needs: gh_build_image
226+
container:
227+
# until https://github.com/github/docs/issues/25520 is resolved, using vars
228+
image: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/datalens_ci_with_code:${{ github.sha }}"
229+
credentials:
230+
username: ${{ github.actor }}
231+
password: ${{ secrets.GITHUB_TOKEN }}
232+
steps:
233+
- name: 'Cleanup build folder'
234+
run: |
235+
rm -rf ./* || true
236+
rm -rf ./.??* || true
237+
- name: Checkout code
238+
uses: actions/checkout@v4
239+
with:
240+
fetch-depth: 1
241+
- run: |
242+
task cq:check_dir -- .
243+
task cq:check_dir_strict -- .
244+
env:
245+
VENV_PATH: /venv
246+
SKIP_RUFF: true
247+
248+
codestyle_changed_without_ruff:
249+
runs-on: [ self-hosted, linux, light ]
250+
needs: gh_build_image
251+
container:
252+
# until https://github.com/github/docs/issues/25520 is resolved, using vars
253+
image: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/datalens_ci_with_code:${{ github.sha }}"
254+
credentials:
255+
username: ${{ github.actor }}
256+
password: ${{ secrets.GITHUB_TOKEN }}
257+
steps:
258+
- name: 'Cleanup build folder'
259+
run: |
260+
rm -rf ./* || true
261+
rm -rf ./.??* || true
262+
- name: Checkout code
263+
uses: actions/checkout@v4
264+
with:
265+
fetch-depth: 0
266+
submodules: true
267+
# https://github.com/actions/runner-images/issues/6775
268+
- run: git config --global --add safe.directory .
269+
- run: git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
270+
- run: |
271+
TARGET=$(. /venv/bin/activate && dl-git range-diff-paths --only-added-commits --base ${{ github.event.pull_request.base.sha }} --head ${{ github.event.pull_request.head.sha }})
272+
echo $TARGET
273+
task cq:check_target -- "$TARGET"
274+
task cq:check_target_strict -- "$TARGET" 1>/dev/null 2>/dev/null
275+
env:
276+
VENV_PATH: /venv
277+
SKIP_RUFF: true
278+
TEST_TARGET_OVERRIDE: ${{ github.event.inputs.test_targets }}

lib/dl_api_lib/dl_api_lib_tests/db/data_api/result/test_markup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import pytest
66

7-
from dl_api_lib_testing.data_api_base import DataApiTestParams
87
from dl_api_client.dsmaker.shortcuts.result_data import get_data_rows
8+
from dl_api_lib_testing.data_api_base import DataApiTestParams
99
from dl_api_lib_tests.db.base import DefaultApiTestBase
1010

1111

metapkg/poetry.lock

+28-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metapkg/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ datalens-attrs-model-mapper-doc-tools = {path = "../lib/dl_attrs_model_mapper_do
152152
[tool.poetry.group.dev.dependencies]
153153
black = "==23.3.0"
154154
ruff = "==0.0.267"
155+
isort = "==5.12.0"
155156
ipdb = "==0.13.13"
156157
pyodbc = "==4.0.35"
157158
pytest = "==7.2.2"

0 commit comments

Comments
 (0)