mdns-sd-discovery 0.3.0

Async wrapper for native DNS-SD/mDNS service discovery
Documentation
name: SonarCloud analysis

# Project key/organization and the coverage report path live in
# sonar-project.properties; SONAR_TOKEN comes from the repo secrets.

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

permissions:
  contents: read
  pull-requests: read # allows SonarCloud to decorate PRs with analysis results

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  analysis:
    # Dependabot PRs run without access to repo secrets, so the scanner would
    # fail with an empty SONAR_TOKEN; main-branch analysis after merge still
    # covers those changes.
    if: github.actor != 'dependabot[bot]'
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0  # full history improves blame and new-code detection

      - name: Set up build environment
        uses: ./.github/actions/setup

      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@3d7d7cd5ac7f994c1892ae0c06165095b9139094
        with:
          tool: cargo-llvm-cov

      - name: Generate test coverage
        run: |
          rustup component add llvm-tools
          cargo llvm-cov --locked --lcov --output-path lcov.info

      - name: Analyze with SonarCloud
        uses: SonarSource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f #v8.2.1
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}