Skip to content

fix .github/workflows/mcp.yml - add renamify-mcp/pnpm-lock.yaml #37

fix .github/workflows/mcp.yml - add renamify-mcp/pnpm-lock.yaml

fix .github/workflows/mcp.yml - add renamify-mcp/pnpm-lock.yaml #37

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
ci_test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
# - windows-latest
rust: [stable]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
ci_coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
run: |
# Install compatible version for Rust 1.80.1
cargo install cargo-llvm-cov --version 0.6.15
- name: Generate code coverage
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Check coverage threshold
run: |
COVERAGE_THRESHOLD=85
# Run coverage and capture output
COVERAGE_OUTPUT=$(cargo llvm-cov --workspace 2>&1)
echo "$COVERAGE_OUTPUT"
# Extract coverage percentage from the TOTAL line
COVERAGE=$(echo "$COVERAGE_OUTPUT" | grep "^TOTAL" | awk '{print $10}' | sed 's/%//')
echo "Coverage: ${COVERAGE}%"
# Check if coverage meets the threshold
if (( $(echo "${COVERAGE} < ${COVERAGE_THRESHOLD}.00" | bc -l) )); then
echo "Coverage is below ${COVERAGE_THRESHOLD}% threshold: ${COVERAGE}%"
exit 1
fi
echo "Coverage meets ${COVERAGE_THRESHOLD}% threshold: ${COVERAGE}%"
- name: Generate HTML report
run: cargo llvm-cov --workspace --html
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: target/llvm-cov/html/
ci_msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust 1.80.1
uses: dtolnay/rust-toolchain@1.80.1
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Check MSRV
run: |
# Downgrade half package for MSRV compatibility
cargo update half@2.6.0 --precise 2.4.1 || true
cargo check --all-targets