ci: add strict test evidence gates

This commit is contained in:
Joseph Magly
2026-08-14 11:44:12 -04:00
parent 2e703e19e2
commit 66c47249df
16 changed files with 443 additions and 6 deletions
+40 -3
View File
@@ -95,11 +95,17 @@ jobs:
run: python -m pip install "ruff==0.8.6"
- name: Enforce Ruff F gate
run: python -m ruff check --select F obliteratus tests scripts/gemma4_12b_recursive_loop.py
run: >-
python -m ruff check --select F obliteratus tests
scripts/check_coverage_thresholds.py
scripts/gemma4_12b_recursive_loop.py
- name: Report E501 legacy baseline
if: always()
run: python -m ruff check --select E501 --statistics obliteratus tests scripts/gemma4_12b_recursive_loop.py || true
run: >-
python -m ruff check --select E501 --statistics obliteratus tests
scripts/check_coverage_thresholds.py
scripts/gemma4_12b_recursive_loop.py || true
test:
name: Tests py${{ matrix.python-version }}
@@ -112,6 +118,13 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
env:
CUDA_VISIBLE_DEVICES: ""
HF_DATASETS_OFFLINE: "1"
HF_HUB_DISABLE_TELEMETRY: "1"
HF_HUB_OFFLINE: "1"
TOKENIZERS_PARALLELISM: "false"
TRANSFORMERS_OFFLINE: "1"
steps:
- name: Check out repository
@@ -151,4 +164,28 @@ jobs:
python -m obliteratus --help
- name: Run tests with coverage
run: python -m pytest
run: |
mkdir -p test-results
python -m pytest \
-m "not slow and not gpu and not mps and not mlx and not network and not download and not remote" \
--cov-branch \
--cov-fail-under=0 \
--junitxml="test-results/junit-py${{ matrix.python-version }}.xml" \
--cov-report="xml:test-results/coverage-py${{ matrix.python-version }}.xml" \
--cov-report="json:test-results/coverage-py${{ matrix.python-version }}.json"
- name: Enforce line and branch coverage floors
run: >-
python scripts/check_coverage_thresholds.py
"test-results/coverage-py${{ matrix.python-version }}.json"
--min-line 49
--min-branch 36
- name: Upload test and coverage evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-evidence-py${{ matrix.python-version }}
path: test-results/
if-no-files-found: error
retention-days: 14