Skip to content

Commit 9e53886

Browse files
sidmohan0claude
andauthored
chore(ci): consolidate 7 workflows into 3 (#117)
* chore(ci): consolidate 7 workflows into 3 Replace 5 overlapping release workflows (nightly, beta, weekly, publish-pypi, pre-commit-auto-fix) with a single unified release.yml that chains determine-release → test → publish → cleanup. Tests are now a hard gate for all releases. - Fix .bumpversion.cfg version drift (4.1.1 → 4.3.0) - Add concurrency controls and consolidate redundant CI test jobs - Add gitleaks secret scanning and pre-commit-hooks to .pre-commit-config.yaml - Add --alpha flag to generate_changelog.py - Update Claude.md to reflect new 3-workflow architecture Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * style: fix black formatting in generate_changelog.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 63e6403 commit 9e53886

File tree

11 files changed

+383
-789
lines changed

11 files changed

+383
-789
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 4.1.1
2+
current_version = 4.3.0
33
commit = True
44
tag = True
55
tag_name = v{new_version}

.github/workflows/beta-release.yml

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

.github/workflows/ci.yml

Lines changed: 14 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [main, dev]
88

9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
lint:
1115
runs-on: ubuntu-latest
@@ -20,7 +24,7 @@ jobs:
2024
- name: Run pre-commit
2125
run: pre-commit run --all-files --show-diff-on-failure
2226

23-
build:
27+
test:
2428
runs-on: ubuntu-latest
2529
strategy:
2630
matrix:
@@ -41,86 +45,38 @@ jobs:
4145
- name: Install dependencies
4246
run: |
4347
python -m pip install --upgrade pip
44-
pip install -e ".[dev]"
48+
pip install -e ".[all,dev]"
4549
pip install -r requirements-dev.txt
46-
pip install -e ".[nlp,cli]"
4750
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1.tar.gz
4851
49-
- name: Run test suite (ignore segfault during cleanup)
50-
run: |
51-
python -m pytest tests/ -v --ignore=tests/test_gliner_annotator.py || echo "Tests completed successfully, segfault during cleanup ignored"
52-
53-
- name: Verify test results (check for test failures vs cleanup segfault)
52+
- name: Run tests with segfault protection
5453
run: |
55-
# Run tests again to capture just the test results without letting segfault fail the job
56-
python -m pytest tests/ -v --ignore=tests/test_gliner_annotator.py > test_results.txt 2>&1 || true
57-
58-
# Check if tests actually passed
59-
if grep -q "failed" test_results.txt; then
60-
echo "❌ Tests actually failed:"
61-
cat test_results.txt
62-
exit 1
63-
elif grep -q "passed" test_results.txt; then
64-
echo "✅ Tests passed successfully (cleanup segfault ignored)"
65-
grep "passed" test_results.txt
66-
else
67-
echo "⚠️ Unable to determine test status"
68-
cat test_results.txt
69-
exit 1
70-
fi
71-
54+
python run_tests.py tests/ --ignore=tests/test_gliner_annotator.py --cov-report=xml --cov-config=.coveragerc
55+
7256
- name: Validate GLiNER module structure (without PyTorch dependencies)
7357
run: |
7458
python -c "
7559
print('Validating GLiNER module can be imported without PyTorch...')
7660
try:
7761
from datafog.processing.text_processing.gliner_annotator import GLiNERAnnotator
78-
print('GLiNER imported unexpectedly - PyTorch may be installed')
62+
print('GLiNER imported unexpectedly - PyTorch may be installed')
7963
except ImportError as e:
8064
if 'GLiNER dependencies not available' in str(e):
81-
print('GLiNER properly reports missing dependencies (expected in CI)')
65+
print('GLiNER properly reports missing dependencies (expected in CI)')
8266
else:
83-
print(f'GLiNER import blocked as expected: {e}')
67+
print(f'GLiNER import blocked as expected: {e}')
8468
except Exception as e:
85-
print(f'Unexpected GLiNER error: {e}')
69+
print(f'Unexpected GLiNER error: {e}')
8670
exit(1)
8771
"
88-
89-
- name: Run coverage
90-
run: |
91-
python -m pytest tests/ -v --ignore=tests/test_gliner_annotator.py --cov=datafog --cov-report=xml --cov-config=.coveragerc
9272
9373
- name: Upload coverage
74+
if: matrix.python-version == '3.10'
9475
uses: codecov/codecov-action@v4
9576
with:
9677
file: ./coverage.xml
9778
token: ${{ secrets.CODECOV_TOKEN }}
9879

99-
test-core:
100-
runs-on: ubuntu-latest
101-
strategy:
102-
matrix:
103-
python-version: ["3.10", "3.11", "3.12"]
104-
steps:
105-
- uses: actions/checkout@v4
106-
- name: Set up Python ${{ matrix.python-version }}
107-
uses: actions/setup-python@v5
108-
with:
109-
python-version: ${{ matrix.python-version }}
110-
cache: "pip"
111-
112-
- name: Install core dependencies only
113-
run: |
114-
python -m pip install --upgrade pip
115-
pip install -e .
116-
pip install pytest pytest-cov
117-
118-
- name: Test core functionality
119-
run: |
120-
python -c "from datafog import detect_pii, anonymize_text; print('Core API works')"
121-
python -c "from datafog import detect, process; print('Legacy API works')"
122-
python -m pytest tests/test_regex_annotator.py -v
123-
12480
wheel-size:
12581
runs-on: ubuntu-latest
12682
steps:

0 commit comments

Comments
 (0)