Skip to content

Commit

Permalink
ci: add code quality workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ovsds committed Oct 26, 2023
1 parent ad03ba8 commit 517e29c
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,64 @@ 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: ${{ secrets.DL_CI_CR_USER }}
password: ${{ secrets.DL_CI_CR_TOKEN }}
steps:
- name: 'Cleanup build folder'
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- 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: ${{ secrets.DL_CI_CR_USER }}
password: ${{ secrets.DL_CI_CR_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
- 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 }}

0 comments on commit 517e29c

Please sign in to comment.