-
Notifications
You must be signed in to change notification settings - Fork 25
48 lines (39 loc) · 1.18 KB
/
mypy.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
43
44
45
46
47
48
name: Mypy Checks
on:
pull_request:
branches:
- "develop"
concurrency:
group: ${{ github.workflow_ref }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mypy:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
- name: Filter Python files
id: filter-python
run: |
python_files=()
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ $file == *.py ]]; then
python_files+=("${file}")
fi
done
echo "python_files=${python_files[*]}" >> $GITHUB_ENV
- name: Add MyPy annotator
uses: pr-annotators/[email protected]
- name: Run mypy
if: ${{ env.python_files != '' }}
run: |
echo "Running mypy on changed files: ${{ env.python_files }}"
uv run mypy --no-pretty --show-absolute-path ${{ env.python_files }}