-
Notifications
You must be signed in to change notification settings - Fork 10
51 lines (51 loc) · 1.68 KB
/
code-quality.yml
File metadata and controls
51 lines (51 loc) · 1.68 KB
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
name: Code Quality
on:
workflow_call:
inputs:
path:
description: "Path to the Python files"
required: true
type: string
jobs:
code-quality:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: azure/setup-helm@v4.2.0
with:
version: "latest"
id: install
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Get changed python files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
${{ inputs.path }}
- name: Install dependencies
run: uv sync --frozen --extra dev
- name: check black formatting
run: uv run black --check --diff --config ./pyproject.toml .
- name: lint helm charts
run: helm lint --strict ./charts/logprep
- name: lint changed and added files
if: steps.changed-files.outputs.all_changed_files
run: uv run pylint ${{ steps.changed-files.outputs.all_changed_files }}
- name: mypy type checking
if: steps.changed-files.outputs.all_changed_files
run: uv run mypy --follow-imports=skip ${{ steps.changed-files.outputs.all_changed_files }}
- name: Run tests and collect coverage
run: uv run pytest tests/unit --cov=logprep --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}