Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add code quality workflow #46

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,60 @@ jobs:
./report/**/*.xml
event_name: ${{ github.event.workflow_run.event }}
report_individual_runs: "true"

codestyle_all_without_ruff:
runs-on: [self-hosted, linux, light]
needs: gh_build_image
container:
# until https://github.com/github/docs/issues/25520 is resolved, using vars
image: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/datalens_ci_with_code:${{ github.sha }}"
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: 'Cleanup build folder'
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- run: |
task cq:check_dir -- .
task cq:check_dir_strict -- .
env:
VENV_PATH: /venv
SKIP_RUFF: true

codestyle_changed_without_ruff:
runs-on: [ self-hosted, linux, light ]
needs: gh_build_image
container:
# until https://github.com/github/docs/issues/25520 is resolved, using vars
image: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/datalens_ci_with_code:${{ github.sha }}"
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: 'Cleanup build folder'
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
# https://github.com/actions/runner-images/issues/6775
- run: git config --global --add safe.directory .
- run: git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- run: |
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 }})
echo $TARGET
task cq:check_target -- "$TARGET"
task cq:check_target_strict -- "$TARGET" 1>/dev/null 2>/dev/null
env:
VENV_PATH: /venv
SKIP_RUFF: true
TEST_TARGET_OVERRIDE: ${{ github.event.inputs.test_targets }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import pytest

from dl_api_lib_testing.data_api_base import DataApiTestParams
from dl_api_client.dsmaker.shortcuts.result_data import get_data_rows
from dl_api_lib_testing.data_api_base import DataApiTestParams
from dl_api_lib_tests.db.base import DefaultApiTestBase


Expand Down
29 changes: 28 additions & 1 deletion metapkg/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions metapkg/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ datalens-attrs-model-mapper-doc-tools = {path = "../lib/dl_attrs_model_mapper_do
[tool.poetry.group.dev.dependencies]
black = "==23.3.0"
ruff = "==0.0.267"
isort = "==5.12.0"
ipdb = "==0.13.13"
pyodbc = "==4.0.35"
pytest = "==7.2.2"
Expand Down
Loading