Skip to content

Commit 57913b1

Browse files
ci: Optimize linting workflow with parallel execution.
- Implement matrix strategy for Black, isort, and Flake8 - Enable parallel job execution (max 3 concurrent jobs) - Add pip caching for faster dependency installation - Update GitHub Actions versions (checkout@v4, setup-python@v5) - Remove redundant steps and unify tool execution
1 parent 78255b7 commit 57913b1

File tree

2 files changed

+44
-88
lines changed

2 files changed

+44
-88
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/linting.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
tool: [black, isort, flake8]
15+
max-parallel: 3
16+
fail-fast: false
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.13'
25+
cache: 'pip'
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r requirements/dev.txt
37+
38+
- name: Run ${{ matrix.tool }}
39+
shell: bash
40+
env:
41+
TOOL: ${{ matrix.tool }}
42+
run: |
43+
$TOOL --version
44+
$TOOL . --check --verbose

0 commit comments

Comments
 (0)