-
Notifications
You must be signed in to change notification settings - Fork 8
142 lines (139 loc) · 5.45 KB
/
code-quality.yml
File metadata and controls
142 lines (139 loc) · 5.45 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Code Quality Checks
on:
workflow_call:
permissions:
contents: read
id-token: write
jobs:
black:
runs-on: ubuntu-latest
steps:
- name: Clean up potential remnants of past jobs
uses: AutoModality/action-clean@v1.1.0
- name: Checkout out repository
uses: actions/checkout@v6
- name: Setup up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Analysing the code with black
shell: bash
run: |
python -m pip install black
black src --check --verbose --diff --color --line-length 120
black test --check --verbose --diff --color --line-length 120
clang-format:
runs-on: ubuntu-latest
steps:
- name: Clean up potential remnants of past jobs
uses: AutoModality/action-clean@v1.1.0
- name: Checkout out repository
uses: actions/checkout@v6
- name: Format C++ code with clang-format
shell: bash
run: |
python -m pip install clang-format
find csrc/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format --dry-run --Werror
mypy:
runs-on: ubuntu-latest
container:
image: josafatburmeister/pointtree:latest
volumes:
- ${{ github.workspace }}:/github/workspace
steps:
- name: Clean up potential remnants of past jobs
uses: AutoModality/action-clean@v1.1.0
- name: Checkout out repository
uses: actions/checkout@v6
- name: Analysing the code with mypy
shell: bash
run: |
cd /github/workspace/
pip install torch==2.10.0
pip install torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
python -m pip install -v --upgrade -e .'[dev, docs]'
mypy . --warn-unused-ignores --show-error-codes --no-incremental
pylint:
runs-on: ubuntu-latest
container:
image: josafatburmeister/pointtree:latest
volumes:
- ${{ github.workspace }}:/github/workspace
steps:
- name: Clean up potential remnants of past jobs
uses: AutoModality/action-clean@v1.1.0
- name: Checkout out repository
uses: actions/checkout@v6
- name: Analysing the code with pylint
shell: bash
run: |
cd /github/workspace/
pip install torch==2.10.0
pip install torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
python -m pip install -v --upgrade .'[dev, docs]'
pylint src --rcfile=.rcfile
pylint test --rcfile=.rcfile --disable duplicate-code --disable missing-function-docstring
test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [
{python: "3.11", torch: "2.7.0", image: "python:3.11-trixie"},
{python: "3.12", torch: "2.8.0", image: "python:3.12-trixie"},
{python: "3.13", torch: "2.9.0", image: "python:3.13-trixie"},
{python: "3.14", torch: "2.10.0", image: "python:3.14-trixie"}
]
container:
image: ${{ matrix.version.image }}
volumes:
- ${{ github.workspace }}:/github/workspace
steps:
- name: Clean up potential remnants of past jobs
uses: AutoModality/action-clean@v1.1.0
- name: Checkout out repository
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Install package and dependencies
if: ${{ matrix.version.python < '3.14'}}
shell: bash
run: |
python -m pip install torch==${{ matrix.version.torch }}
python -m pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
python -m pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
python -m pip install --upgrade -e .'[dev, docs]'
- name: Install package and dependencies
if: ${{ matrix.version.python >= '3.14'}}
shell: bash
run: |
python -m pip install torch==${{ matrix.version.torch }}
python -m pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
python -m pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
cd /github/workspace/
python -m pip install --upgrade -e .'[dev, docs]'
- name: Execute tests
if: matrix.version.python < '3.14'
shell: bash
run: |
cd /github/workspace/
pytest
- name: Execute tests (without numba JIT) and measure code coverage
if: matrix.version.python == '3.14'
shell: bash
run: |
cd /github/workspace/
NUMBA_DISABLE_JIT=1 pytest --cov --cov-report=xml
- name: Upload results to Codecov
if: matrix.version.python == '3.14'
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
use_oidc: true
verbose: true