TASK-ETH-001: 4 discovery bias tests (genre/tag browse, emerging artist visibility, metrics not exposed in JSON). Verifies chronological ordering regardless of play count. TASK-ETH-002: 4 search fairness tests (artist 0 plays discoverable, zero-play tracks not filtered, default sort is chronological, no popularity bias in default ranking). TASK-ETH-003: veza-docs/DISCOVERY_ALGORITHM.md — documents all 6 discovery mechanisms, ethical constraints, and forbidden patterns per ORIGIN specs. TASK-COV-001: CI coverage gates — Go >= 70% (backend-ci.yml), Rust >= 50% (rust-ci.yml with cargo-tarpaulin). Extended Go test scope to core/ and middleware/. TASK-COV-002: Coverage badge JSON artifact on main push (shields.io compatible). All 8 ethical tests PASS. Build clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
name: Rust CI
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'veza-stream-server/**'
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- 'veza-stream-server/**'
|
|
|
|
jobs:
|
|
test-and-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
|
|
with:
|
|
components: clippy
|
|
|
|
- name: Clippy lint
|
|
run: cargo clippy -- -D warnings
|
|
working-directory: veza-stream-server
|
|
|
|
- name: Run tests
|
|
run: cargo test --workspace --timeout 300
|
|
working-directory: veza-stream-server
|
|
|
|
- name: Install cargo-tarpaulin
|
|
run: cargo install cargo-tarpaulin
|
|
|
|
- name: Measure coverage
|
|
run: cargo tarpaulin --out json --output-dir target/coverage --timeout 300 --skip-clean
|
|
working-directory: veza-stream-server
|
|
|
|
- name: Enforce coverage threshold (>= 50%)
|
|
run: |
|
|
COVERAGE=$(cat target/coverage/tarpaulin-report.json | python3 -c "import sys,json; print(f'{json.load(sys.stdin).get(\"coverage\", 0):.1f}')")
|
|
echo "Rust coverage: ${COVERAGE}%"
|
|
COV_INT=$(echo "$COVERAGE" | cut -d. -f1)
|
|
if [ "$COV_INT" -lt 50 ]; then
|
|
echo "::error::Rust coverage ${COVERAGE}% is below the 50% threshold"
|
|
exit 1
|
|
fi
|
|
echo "::notice::Rust coverage ${COVERAGE}% meets the >= 50% threshold"
|
|
working-directory: veza-stream-server
|
|
|
|
- name: Upload coverage report
|
|
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
|
with:
|
|
name: rust-coverage
|
|
path: veza-stream-server/target/coverage/tarpaulin-report.json
|