Skip to content

Commit d8aad27

Browse files
author
Zvi Fried
committed
feat: enhance CI workflow with parallelization and mandatory checks
- Remove semantic release workflow for manual version management - Parallelize CI jobs: code-quality, tests, security, gitleaks - Add gitleaks secret scanning with full git history - Split linting/type checking from tests for faster feedback - Update branch protection to require all parallel CI jobs - Remove semantic release configuration files (.releaserc.json, node_modules) - All CI jobs must pass before merge is allowed CI Jobs: ✅ Code Quality: linting, formatting, type checking ✅ Test Suite: pytest with coverage ✅ Security Scan: bandit security linter ✅ Secret Scanning: gitleaks for credential detection ✅ Build Package: verify package builds correctly ✅ Docker Build: verify Docker image builds Branch Protection: - Requires: Code Quality, Test Suite, Security Scan, Secret Scanning - Pull request reviews: 1 approval required - Dismiss stale reviews on new commits - Code owner review required
1 parent 77b052b commit d8aad27

File tree

3 files changed

+54
-158
lines changed

3 files changed

+54
-158
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ env:
1010
PYTHON_VERSION: "3.13"
1111

1212
jobs:
13-
test:
14-
name: Test Suite
13+
# Parallel job 1: Code Quality (linting, formatting, type checking)
14+
code-quality:
15+
name: Code Quality
1516
runs-on: ubuntu-latest
16-
strategy:
17-
matrix:
18-
python-version: ["3.13"]
1917

2018
steps:
2119
- name: Checkout code
@@ -26,21 +24,42 @@ jobs:
2624
with:
2725
version: "latest"
2826

29-
- name: Set up Python ${{ matrix.python-version }}
30-
run: uv python install ${{ matrix.python-version }}
27+
- name: Set up Python
28+
run: uv python install ${{ env.PYTHON_VERSION }}
3129

3230
- name: Install dependencies
33-
run: |
34-
uv sync --all-extras --dev
31+
run: uv sync --all-extras --dev
3532

3633
- name: Run linting
3734
run: |
3835
uv run ruff check src tests
3936
uv run ruff format --check src tests
4037
4138
- name: Run type checking
42-
run: |
43-
uv run mypy src
39+
run: uv run mypy src
40+
41+
# Parallel job 2: Tests
42+
tests:
43+
name: Test Suite
44+
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
python-version: ["3.13"]
48+
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v5
52+
53+
- name: Install uv
54+
uses: astral-sh/setup-uv@v6
55+
with:
56+
version: "latest"
57+
58+
- name: Set up Python ${{ matrix.python-version }}
59+
run: uv python install ${{ matrix.python-version }}
60+
61+
- name: Install dependencies
62+
run: uv sync --all-extras --dev
4463

4564
- name: Run tests
4665
run: |
@@ -56,13 +75,16 @@ jobs:
5675
env:
5776
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5877

78+
# Parallel job 3: Security Scanning
5979
security:
6080
name: Security Scan
6181
runs-on: ubuntu-latest
6282

6383
steps:
6484
- name: Checkout code
6585
uses: actions/checkout@v5
86+
with:
87+
fetch-depth: 0 # Full history for gitleaks
6688

6789
- name: Install uv
6890
uses: astral-sh/setup-uv@v6
@@ -75,17 +97,33 @@ jobs:
7597
- name: Install dependencies
7698
run: uv sync --all-extras --dev
7799

78-
79-
80100
- name: Run bandit security linter
81101
run: |
82102
uv add --dev bandit
83103
uv run bandit -r src/
84104
105+
# Parallel job 4: Secret Scanning with Gitleaks
106+
gitleaks:
107+
name: Secret Scanning
108+
runs-on: ubuntu-latest
109+
110+
steps:
111+
- name: Checkout code
112+
uses: actions/checkout@v5
113+
with:
114+
fetch-depth: 0 # Full history for gitleaks
115+
116+
- name: Run Gitleaks
117+
uses: gitleaks/gitleaks-action@v2
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
121+
122+
# Build job - depends on all parallel jobs
85123
build:
86124
name: Build Package
87125
runs-on: ubuntu-latest
88-
needs: [test, security]
126+
needs: [code-quality, tests, security, gitleaks]
89127

90128
steps:
91129
- name: Checkout code
@@ -118,10 +156,11 @@ jobs:
118156
path: dist/
119157
retention-days: 7
120158

159+
# Docker job - depends on all parallel jobs
121160
docker:
122161
name: Build Docker Image
123162
runs-on: ubuntu-latest
124-
needs: [test, security]
163+
needs: [code-quality, tests, security, gitleaks]
125164

126165
steps:
127166
- name: Checkout code

.github/workflows/semantic-release.yml

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

.releaserc.json

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

0 commit comments

Comments
 (0)