Skip to content

Skip Codecov upload until repository is public #2

Skip Codecov upload until repository is public

Skip Codecov upload until repository is public #2

Workflow file for this run

name: Coverage

Check failure on line 1 in .github/workflows/coverage.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/coverage.yml

Invalid workflow file

(Line: 60, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.CODECOV_TOKEN != ''
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Run tests with coverage
run: |
cargo llvm-cov --workspace --lib \
--exclude wasm-runner \
--exclude inference-playground-server \
--lcov --output-path lcov.info
- name: Generate coverage summary
run: |
cargo llvm-cov --workspace --lib \
--exclude wasm-runner \
--exclude inference-playground-server \
--summary-only
- name: Check AST module coverage threshold
run: |
# Extract coverage for AST files
COVERAGE=$(cargo llvm-cov --workspace --lib \
--exclude wasm-runner \
--exclude inference-playground-server \
--summary-only 2>&1 | \
grep 'ast/src' | \
awk '{sum+=$7; count++} END {if (count>0) print sum/count; else print 0}')
echo "Average AST module coverage: ${COVERAGE}%"
# Threshold currently at 40% (actual current coverage)
# Target is 98%, increase gradually as tests are added
THRESHOLD=40
if (( $(echo "$COVERAGE < $THRESHOLD" | bc -l) )); then
echo "Coverage ${COVERAGE}% is below threshold ${THRESHOLD}%"
exit 1
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ secrets.CODECOV_TOKEN != '' }}
continue-on-error: true
with:
files: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}