Add CI quality-gate baseline and merge policy targets
Some checks failed
CI / test-and-quality (push) Failing after 35s
Some checks failed
CI / test-and-quality (push) Failing after 35s
This commit is contained in:
37
.gitea/workflows/ci.yml
Normal file
37
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [ main, 'feature/**', 'release/**' ]
|
||||
|
||||
jobs:
|
||||
test-and-quality:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
pip install pytest pytest-cov ruff black mypy
|
||||
|
||||
- name: Lint
|
||||
run: ruff check .
|
||||
|
||||
- name: Format check
|
||||
run: black --check .
|
||||
|
||||
- name: Type check
|
||||
run: mypy . || true
|
||||
|
||||
- name: Tests + coverage
|
||||
run: |
|
||||
pytest --maxfail=1 --disable-warnings --cov=. --cov-report=term-missing --cov-report=xml --cov-fail-under=70
|
||||
7
TODO.md
7
TODO.md
@@ -116,3 +116,10 @@ Byg **Weirsøe Party Protocol**: en dansk party-webapp platform ala Jackbox, hvo
|
||||
- [ ] Opret .po for en og da (dev beholdes som udviklingssprog)
|
||||
- [ ] Tilføj make-targets/kommandoer for makemessages og compilemessages
|
||||
- [ ] Tilføj test der sikrer i18n tags i templates (inspireret af email-manager)
|
||||
|
||||
### Fase 12 — CI/CD og merge-gates (Gitea)
|
||||
- [ ] Opret CI-workflow i .gitea/workflows/ci.yml
|
||||
- [ ] Kør lint, format, tests, coverage i CI
|
||||
- [ ] Enforce coverage >= 70%
|
||||
- [ ] Branch protection på main (kræv grøn CI + review)
|
||||
- [ ] Tilføj quality gate-dokumentation i docs/QUALITY_GATES.md
|
||||
|
||||
17
docs/QUALITY_GATES.md
Normal file
17
docs/QUALITY_GATES.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Quality gates (mål)
|
||||
|
||||
## Merge til main kræver
|
||||
1. Alle tests grønne
|
||||
2. Test coverage >= 70%
|
||||
3. Lint/format/type checks grønne
|
||||
|
||||
## Planlagte checks
|
||||
- pytest + pytest-cov (coverage XML + summary)
|
||||
- ruff (lint)
|
||||
- black --check (format)
|
||||
- mypy (type checks, gradvis indfasning)
|
||||
|
||||
## Enforcement i Gitea
|
||||
- Branch protection på main
|
||||
- Kræv successful checks fra CI-workflow før merge
|
||||
- Kræv mindst 1 review (kan justeres)
|
||||
Reference in New Issue
Block a user