-
Notifications
You must be signed in to change notification settings - Fork 34
35 lines (31 loc) · 1.08 KB
/
sonarqube.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
name: SonarQube Analysis
on:
# Trigger analysis when pushing in master
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarqube:
# Dependabot actor does not have access to secrets so skill the analysis
if: ${{ github.actor != 'dependabot[bot]' }}
name: SonarQube Trigger
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Setup java 17
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: SonarCloud Analysis
if: ${{ github.repository == 'mars-sim/mars-sim' }}
env:
SONAR_ORGANISATION: ${{ secrets.SONAR_ORGANISATION }}
SONAR_LOGIN: ${{ secrets.SONAR_LOGIN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
mvn --file pom.xml -B -Pcoverage -Dsonar.token=$SONAR_LOGIN -Dsonar.projectKey=com.mars-sim:mars-sim -Dsonar.organization=$SONAR_ORGANISATION verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar