forked from openvinotoolkit/anomalib
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 1.53 KB
/
_reusable-code-quality.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Code Quality Workflow
#
# This reusable workflow executes code quality checks using pre-commit hooks
# and other quality assurance tools across multiple languages.
#
# Key Features:
# - Pre-commit hook execution
# - Multi-language support
# - Dependency caching
# - Configurable environments
# - Parallel check execution
#
# Process Stages:
# 1. Environment Preparation:
# - Python setup
# - Cache configuration
#
# 2. Quality Checks:
# - Code linting
# - Style verification
# - Type checking
# - Best practices validation
#
# 3. Results Processing:
# - Error reporting
# - Check summaries
# - Status updates
#
# Required Inputs:
# - python-version: Python version for checks (default: "3.10")
#
# Example Usage:
# 1. Default Configuration:
# jobs:
# quality:
# uses: ./.github/workflows/_reusable-code-quality.yaml
#
# 2. Custom Versions:
# jobs:
# quality:
# uses: ./.github/workflows/_reusable-code-quality.yaml
# with:
# python-version: "3.11"
#
# Note: Requires configured pre-commit hooks in repository
name: Reusable Code Quality
on:
workflow_call:
inputs:
python-version:
description: "Python version for checks"
type: string
default: "3.10"
jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: ./.github/actions/code-quality/pre-commit
with:
python-version: ${{ inputs.python-version }}