add coverage report #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SonarQube scan | |
| on: | |
| # Trigger analysis when pushing to your main branches, and when creating a pull request. | |
| push: | |
| branches: | |
| - main | |
| - 'release/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| SonarQube: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare Secrets and Login into Azure | |
| id: get-aad-secret | |
| uses: 'chef/common-github-actions/.github/actions/azure-login@main' | |
| with: | |
| akeyless-access-id: '${{ secrets.AKEYLESS_JWT_ID }}' | |
| - name: Add runner IP to Firewall List | |
| uses: chef/common-github-actions/.github/actions/update-firewall-rule@main | |
| with: | |
| action-to-execute: add | |
| - name: wait | |
| shell: bash | |
| run: | | |
| echo "##[warning]Waiting for 30 seconds to allow the firewall rule to take effect" | |
| sleep 30 | |
| - name: Install native deps for protobuf & ZeroMQ | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler pkg-config libzmq3-dev | |
| - name: Install cargo-tarpaulin | |
| run: cargo install cargo-tarpaulin | |
| - name: Run coverage with Tarpaulin | |
| run: | | |
| # produce an lcov report under ./coverage/ | |
| cargo tarpaulin --out Lcov --output-dir coverage | |
| - name: SonarQube Scan | |
| uses: sonarsource/sonarqube-scan-action@v5.1.0 | |
| continue-on-error: true | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
| - name: Remove Storage Firewall Rule | |
| if: always() | |
| uses: chef/common-github-actions/.github/actions/update-firewall-rule@main | |
| with: | |
| perform-sonar-build: true | |
| action-to-execute: remove | |
| - name: logout | |
| if: always() | |
| shell: bash | |
| run: | | |
| az logout |