Skip to content

feat: initialize Task 3 - Enhanced Semantic Search Capabilities #23

feat: initialize Task 3 - Enhanced Semantic Search Capabilities

feat: initialize Task 3 - Enhanced Semantic Search Capabilities #23

name: Quality Metrics & Coverage
on:
push:
branches: [main, development]
pull_request:
branches: [main, development]
jobs:
test-and-coverage:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
PYTHON_VERSION: "3.10"
steps:
- uses: actions/checkout@v4
- name: Setup pixi with cache fallback
id: setup-pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.49.0
cache: true
continue-on-error: true
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y git
- name: Ensure .pixi environment exists
run: |
if [ ! -d ".pixi" ]; then
echo "No .pixi directory found, initializing pixi environment..."
pixi run || pixi install --locked || pixi install || true
fi
- name: Install dependencies (with retry)
run: |
n=0
until [ "$n" -ge 3 ]
do
pixi install --locked && break
n=$((n+1))
echo "pixi install failed, retrying ($n/3)..."
sleep 5
done
- name: Run tests with coverage (HTML, XML, JSON, Markdown)
run: |
eval "$(pixi shell --env-hook bash)"
pytest tests/ --cov=src/uckn --cov-report=html --cov-report=xml --cov-report=json --cov-report=term --cov-report=term-missing --json-report --json-report-file=pytest-report.json --html=pytest-report.html --self-contained-html
coverage markdown
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
htmlcov/
coverage.xml
coverage.json
coverage.md
.coverage*
pytest-report.json
pytest-report.html
- name: diff-cover (PR only)
if: github.event_name == 'pull_request'
run: |
eval "$(pixi shell --env-hook bash)"
git fetch origin main:refs/remotes/origin/main
diff-cover coverage.xml --compare-branch=origin/main --fail-under=90 --html-report diffcover.html --markdown-report diffcover.md --json-report diffcover.json
- name: Upload diff-cover artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: diffcover-reports
path: |
diffcover.html
diffcover.md
diffcover.json
- name: Comment PR with coverage summary
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
path: coverage.md
- name: Quality Gate
run: |
pixi run quality-gate