-
Notifications
You must be signed in to change notification settings - Fork 62
59 lines (50 loc) · 1.63 KB
/
ty.yml
File metadata and controls
59 lines (50 loc) · 1.63 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
52
53
54
55
56
57
58
59
name: Ty Type Checks
on:
pull_request:
branches:
- "develop"
concurrency:
group: ${{ github.workflow_ref }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ty:
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/changed-files@v46.0.3
- 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: Run ty
if: ${{ env.python_files != '' }}
run: |
echo "Running ty on changed files: ${{ env.python_files }}"
# Filter out test files for type checking
src_files=()
for file in ${{ env.python_files }}; do
if [[ ! $file == *"/tests/"* && ! $file == *"/codegen_tests/"* ]]; then
src_files+=("${file}")
fi
done
# Only run type checking if there are source files to check
if [ ${#src_files[@]} -gt 0 ]; then
echo "Running ty on source files: ${src_files[*]}"
uv run ty check --output-format concise --python-version 3.12 ${src_files[@]}
else
echo "No source files to check, skipping ty"
fi