forked from apache/incubator-kie-optaplanner
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.36 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
48
49
# Runs the SonarCloud analysis of the optaplanner main branch after a PR is merged.
name: SonarCloud Analysis
on:
push:
branches:
- main
paths-ignore:
- 'LICENSE*'
- '.gitignore'
- '**.md'
- '**.adoc'
- '*.txt'
- '.ci/**'
defaults:
run:
shell: bash
jobs:
sonarcloud-analysis:
strategy:
matrix:
os: [ ubuntu-latest ]
java-version: [ 17 ]
maven-version: [ '3.8.7' ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Java and Maven Setup
uses: kiegroup/kie-ci/.ci/actions/maven@main
with:
java-version: ${{ matrix.java-version }}
maven-version: ${{ matrix.maven-version }}
cache-key-prefix: ${{ runner.os }}-${{ matrix.java-version }}-maven${{ matrix.maven-version }}
- name: Build with Maven to measure code coverage
run: mvn -B --fail-at-end clean install -Prun-code-coverage
- name: Run SonarCloud analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: mvn -B --fail-at-end validate -Psonarcloud-analysis -Dsonar.projectKey=org.optaplanner:optaplanner -Dsonar.login=${{ env.SONARCLOUD_TOKEN }}