Sonarcloud CI #5247
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: 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@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run tests with coverage | |
| run: npm run test:coverage | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| 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 |