Skip to content

[All Platforms] - SonarQube Scan - Scheduled #99

[All Platforms] - SonarQube Scan - Scheduled

[All Platforms] - SonarQube Scan - Scheduled #99

Workflow file for this run

name: "[All Platforms] - SonarQube Scan - Scheduled"
on:
schedule:
- cron: "0 2 * * 1-5" # every working day at 2am we will do a daily scan on develop
workflow_dispatch:
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="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm
pnpm i --filter="ledger-live-desktop..." --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 coverage files
run: |
cat apps/ledger-live-desktop/coverage/lcov.info apps/ledger-live-mobile/coverage/lcov.info > ./lcov.info
cat apps/ledger-live-desktop/coverage/sonar-executionTests-report.xml apps/ledger-live-mobile/coverage/sonar-executionTests-report.xml > ./sonar-executionTests-report.xml
- uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}