-
Notifications
You must be signed in to change notification settings - Fork 123
39 lines (35 loc) · 1.09 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
# This workflow will build a Java project with Maven
# This runs only on PR
name: SonarCloud QA
on:
push:
branches:
- master
jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest']
runs-on: ${{ matrix.os }}
permissions:
checks: write
pull-requests: write
statuses: read
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-v2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-v2-
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify --file pom.xml -B verify sonar:sonar -Dsonar.projectKey=skjolber_3d-bin-container-packing -Dsonar.organization=skjolber-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN