forked from ai4trees/pointtorch
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (143 loc) · 5.66 KB
/
code-quality.yml
File metadata and controls
146 lines (143 loc) · 5.66 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
143
144
145
146
name: Code Quality Checks
on:
workflow_call:
secrets:
codecov_token:
required: false
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
mypy:
runs-on: ubuntu-latest
container:
image: josafatburmeister/pointtorch: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/
python -m pip install --upgrade .'[dev, docs]'
mypy . --warn-unused-ignores --show-error-codes --no-incremental
pylint:
runs-on: ubuntu-latest
container:
image: josafatburmeister/pointtorch: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/
python -m pip install --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.9", torch: "2.4.0", image: "python:3.9-trixie"},
{python: "3.10", torch: "2.5.0", image: "python:3.10-trixie"},
{python: "3.11", torch: "2.6.0", image: "python:3.11-trixie"},
{python: "3.12", torch: "2.7.0", image: "python:3.12-trixie"},
{python: "3.13", torch: "2.8.0", image: "python:3.13-trixie"},
{python: "3.14", torch: "2.9.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:
repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
- name: Install package and dependencies
if: ${{ matrix.version.torch < '2.9.0'}}
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
cd /github/workspace/
python -m pip install --upgrade -e .'[dev, docs]'
- name: Install package and dependencies
if: ${{ matrix.version.torch >= '2.9.0'}}
shell: bash
run: |
apt-get update && apt-get install -y libhdf5-dev
python -m pip install wheel setuptools
python -m pip install git+https://github.com/PyTables/PyTables
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
cd /github/workspace/
python -m pip install --upgrade -e .'[dev, docs]'
- name: Install compatible numpy version
if: ${{ matrix.version.python == '3.9' || matrix.version.python == '3.10' || matrix.version.python == '3.11' }}
shell: bash
run: |
python -m pip install numpy==1.26.4
- name: Executing tests
shell: bash
run: |
cd /github/workspace/
pytest --cov --cov-report=xml
test-with-optional-dependencies:
runs-on: ubuntu-latest
container:
image: josafatburmeister/pointtorch: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
with:
repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
- name: Executing tests
shell: bash
run: |
cd /github/workspace/
python -m pip install --upgrade .'[dev, docs]'
pytest --cov pointtorch --cov-report=xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.codecov_token }}
verbose: true