Skip to content

Commit 3f718b3

Browse files
committed
Revert "Remove pre-commit job and replace it with direct invocations of ruff and mypy"
This reverts commit dcf855f.
1 parent e1aa4bc commit 3f718b3

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

.github/workflows/pytest.yaml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,46 +159,60 @@ jobs:
159159
token: ${{ secrets.CODECOV_TOKEN }}
160160
files: .coverage.xml
161161

162-
code-quality:
162+
pre-commit:
163163
name: Code quality
164164
runs-on: ubuntu-latest
165165
steps:
166+
#------------------------------------
167+
# check-out repo and set-up python
168+
#------------------------------------
166169
- uses: actions/checkout@v4
167170
with:
168171
fetch-depth: 0
169172
- uses: actions/setup-python@v5
170173
with:
171174
python-version: "3.14"
172175

176+
#------------------------------
177+
# install & configure poetry
178+
#------------------------------
173179
- name: Install Poetry
174180
uses: snok/install-poetry@v1
175181
with:
176182
virtualenvs-create: true
177183
virtualenvs-in-project: true
178184
installer-parallel: true
179185

186+
#----------------------------------
187+
# install dynamic version plugin
188+
#----------------------------------
180189
- name: Install poetry-dynamic-versioning
181190
run: poetry self add "poetry-dynamic-versioning[plugin]"
182191

192+
#------------------------------------
193+
# load cached venv if cache exists
194+
#------------------------------------
183195
- name: Load cached venv
184196
id: cached-poetry-dependencies
185197
uses: actions/cache@v4
186198
with:
187199
path: .venv
188200
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
189201

202+
#------------------------------------------------
203+
# install dependencies if cache does not exist
204+
#------------------------------------------------
190205
- name: Install dependencies
191206
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
192207
run: poetry install --no-interaction --no-root --with dev,server
193208

209+
#------------------------
210+
# install root project
211+
#------------------------
194212
- name: Install library
195213
run: poetry install --no-interaction
196214

197-
- name: Run ruff check
198-
run: poetry run ruff check .
199-
200-
- name: Run ruff format check
201-
run: poetry run ruff format --check .
202-
203-
- name: Run mypy
204-
run: poetry run mypy .
215+
#-------------------------------
216+
# run pre-commit/(mypy, ruff)
217+
#-------------------------------
218+
- uses: pre-commit/action@v3.0.1

0 commit comments

Comments
 (0)