msvc-kit 0.2.10

A portable MSVC Build Tools installer and manager for Rust development
name: Code Coverage

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  coverage:
    name: Coverage
    runs-on: windows-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v6

      - name: Setup vx
        uses: loonghao/vx@main
        with:
          version: '0.8.0'
          github-token: ${{ secrets.GITHUB_TOKEN }}

      - name: Setup tools (vx)
        run: vx setup

      - name: Add Rust components
        run: vx rustup component add clippy rustfmt

      - name: Setup MSVC Developer Command Prompt
        uses: ilammy/msvc-dev-cmd@v1

      - name: Fix MSVC linker (remove Git's link.exe)
        run: Remove-Item 'C:\Program Files\Git\usr\bin\link.exe' -Force -ErrorAction SilentlyContinue
        shell: pwsh

      - name: Add llvm-tools-preview
        run: vx rustup component add llvm-tools-preview

      - name: Install cargo-llvm-cov
        run: vx cargo install cargo-llvm-cov --locked

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Generate coverage report
        run: vx just coverage

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: lcov.info
          fail_ci_if_error: false
          verbose: true