Skip to content

[Code Quality Check] Sonar Scan #102

[Code Quality Check] Sonar Scan

[Code Quality Check] Sonar Scan #102

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
with:
fetch-depth: 0
- 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: Setup the toolchain
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop
- 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 --coverageDirectory=desktop-coverage
pnpm mobile test:jest:coverage --coverageDirectory=mobile-coverage
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}