Skip to content

[Code Quality Check] Sonar Scan #135

[Code Quality Check] Sonar Scan

[Code Quality Check] Sonar Scan #135

Workflow file for this run

name: "[Code Quality Check] Sonar Scan"
on:
workflow_dispatch:
inputs:
ref:
description: "Which (branch or tag) you want to perform a sonar scan ?"
required: false
default: develop
schedule:
- cron: "9 19 * * 1-5" # every working day at 7pm we will do a daily scan on develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
scan:
name: Scan LLM && LLD
runs-on: [ledger-live-4xlarge]
steps:
- uses: actions/checkout@v4
- name: Setup git user
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop
- name: Setup the caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
id: caches
with:
skip-turbo-cache: "false"
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- name: Install dependencies
env:
LANG: en_US.UTF-8
run: |
pnpm i --filter="ledger-live-desktop..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --unsafe-perm
pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm
- name: Build dependencies
run: |
pnpm build:lld:deps --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
- name: Generate Unit test coverage for LLD & LLM
run: |
pnpm desktop test:jest:coverage
pnpm mobile test:jest:coverage
- name: Merge lcov files
run: |
cat apps/ledger-live-desktop/coverage/lcov.info apps/ledger-live-mobile/coverage/lcov.info > ./lcov.info
- name: Copy test execution files
run: |
cat apps/ledger-live-desktop/coverage/lld-sonar-executionTests-report.xml > ./lld-sonar-executionTests-report.xml
cat apps/ledger-live-mobile/coverage/llm-sonar-executionTests-report.xml > ./llm-sonar-executionTests-report.xml
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}