name: SonarCloud analysis
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
analysis:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- 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 env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}