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@2ca9b94c269419b7b0c711c09d0b21c4e1d51145
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@713881670b6b3676cda39549040e2d88c70d582e env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}