-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.31 KB
/
sonarcloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: SonarCloud Analysis
on:
push:
branches:
- main # or your default branch
pull_request:
branches:
- main # or your default branch
jobs:
build:
name: SonarCloud Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Required to get a full history for SCM analysis
- name: Set up JDK 11 # SonarCloud scanner needs Java
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for comments on PRs
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # SonarCloud token
with:
projectBaseDir: ./
args: >
-Dsonar.projectKey=EzioDEVio_cicd-pipeline-demo
-Dsonar.organization=eziodevio
-Dsonar.sources=.
-Dsonar.exclusions=**/*.test.js,**/node_modules/**
-Dsonar.tests=.
-Dsonar.test.inclusions=**/*.test.js