-
-
Notifications
You must be signed in to change notification settings - Fork 1k
70 lines (63 loc) · 1.77 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright © Michal Čihař <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
name: mypy
on:
push:
branches-ignore:
- deepsource-fix-**
- renovate/**
- weblate
pull_request:
permissions:
contents: read
jobs:
mypy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get changed files
if: github.event_name == 'pull_request'
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: '**.py'
- name: List all changed files
if: github.event_name == 'pull_request'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
touch changed-files.txt
for file in ${ALL_CHANGED_FILES}; do
echo "$file" >> changed-files.txt
done
cat changed-files.txt
- name: Install apt dependencies
run: sudo ./ci/apt-install
- uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: ''
cache-suffix: '3.13'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Run mypy
run: uv run --no-sources --all-extras --group types mypy --show-column-numbers weblate > mypy.log
# Temporary hack until we have this fully working
continue-on-error: true
- name: Report mypy
if: always()
run: |
echo "::add-matcher::.github/matchers/mypy.json"
if [ -f changed-files.txt ] ; then
if grep --silent --fixed-strings --file=changed-files.txt mypy.log ; then
grep --fixed-strings --file=changed-files.txt mypy.log
fi
else
cat mypy.log
fi
echo "::remove-matcher owner=mypy::"