Skip to content

Sonarcloud CI

Sonarcloud CI #5318

Workflow file for this run

name: Sonarcloud CI
on:
schedule:
# Every day at midnight
- cron: '0 0 * * *'
workflow_dispatch: {}
permissions:
contents: read
pull-requests: read
jobs:
node-sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Run tests with coverage
run: npm run test:coverage
- name: Cache SonarCloud packages
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run SonarCloud Analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
npx sonar-scanner \
-Dsonar.projectKey=Adyen_adyen-node-api-library \
-Dsonar.organization=adyen \
-Dsonar.sources=. \
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info \
-Dsonar.host.url=https://sonarcloud.io