-
Notifications
You must be signed in to change notification settings - Fork 3.3k
42 lines (41 loc) · 1.14 KB
/
python-lint.yml
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
name: Python Code Quality Checks
on:
workflow_dispatch:
pull_request:
branches: [ "main", "feature*" ]
paths:
- 'python/**'
jobs:
pre-commit:
if: '!cancelled()'
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
runs-on: ubuntu-latest
continue-on-error: true
defaults:
run:
working-directory: python
env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
UV_PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.30"
enable-cache: true
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- uses: pre-commit/[email protected]
name: Run Pre-Commit Hooks
with:
extra_args: --config python/.pre-commit-config.yaml --all-files
- name: Run Mypy
run: uv run mypy -p semantic_kernel --config-file mypy.ini
- name: Minimize uv cache
run: uv cache prune --ci