feat: add Codecov coverage reporting to CI workflows

- Update CI workflow Codecov step to use exact format requested in issue #108
- Add coverage reporting to PR workflow for better feedback on pull requests
- Simplify Codecov configuration to use repository slug format
- Include coverage job in PR summary and failure checks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ClaudeBot
2025-05-28 13:28:45 +00:00
parent f0a338d29f
commit ea46c4329e
2 changed files with 38 additions and 8 deletions

View File

@@ -118,15 +118,11 @@ jobs:
GITHUB_WEBHOOK_SECRET: 'test-secret'
GITHUB_TOKEN: 'test-token'
- name: Upload coverage to Codecov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
slug: intelligence-assist/claude-hub
# Security scans - run on GitHub for faster execution
security:

View File

@@ -63,7 +63,39 @@ jobs:
GITHUB_WEBHOOK_SECRET: 'test-secret'
GITHUB_TOKEN: 'test-token'
# Coverage is only uploaded on main branch via ci.yml workflow
# Coverage generation for PR feedback
coverage:
name: Test Coverage
runs-on: ubuntu-latest
needs: [test-unit]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: Generate test coverage
run: npm run test:ci
env:
NODE_ENV: test
BOT_USERNAME: '@TestBot'
GITHUB_WEBHOOK_SECRET: 'test-secret'
GITHUB_TOKEN: 'test-token'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: intelligence-assist/claude-hub
# Integration tests - moderate complexity
test-integration:
@@ -284,7 +316,7 @@ jobs:
pr-summary:
name: PR Summary
runs-on: ubuntu-latest
needs: [lint, test-unit, test-integration, security, codeql, docker-build]
needs: [lint, test-unit, coverage, test-integration, security, codeql, docker-build]
if: always()
steps:
@@ -293,6 +325,7 @@ jobs:
echo "## Pull Request CI Summary"
echo "- Lint & Format: ${{ needs.lint.result }}"
echo "- Unit Tests: ${{ needs.test-unit.result }}"
echo "- Test Coverage: ${{ needs.coverage.result }}"
echo "- Integration Tests: ${{ needs.test-integration.result }}"
echo "- Security Scan: ${{ needs.security.result }}"
echo "- CodeQL Analysis: ${{ needs.codeql.result }}"
@@ -301,6 +334,7 @@ jobs:
# Check for any failures
if [[ "${{ needs.lint.result }}" == "failure" ]] || \
[[ "${{ needs.test-unit.result }}" == "failure" ]] || \
[[ "${{ needs.coverage.result }}" == "failure" ]] || \
[[ "${{ needs.test-integration.result }}" == "failure" ]] || \
[[ "${{ needs.security.result }}" == "failure" ]] || \
[[ "${{ needs.codeql.result }}" == "failure" ]] || \