Skip to content

Commit 5950420

Browse files
committed
Add "test-coverage" and "code-analysis" profiles; add GitHub workflow
1 parent 2922e73 commit 5950420

File tree

6 files changed

+680
-0
lines changed

6 files changed

+680
-0
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-jvm:
11+
name: Build
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v3
23+
with:
24+
distribution: 'adopt'
25+
java-version: 17
26+
27+
- name: Cache SonarCloud packages
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.sonar/cache
31+
key: ${{ runner.os }}-sonar
32+
restore-keys: ${{ runner.os }}-sonar
33+
34+
- name: Cache Maven packages
35+
uses: actions/cache@v3
36+
with:
37+
path: ~/.m2
38+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
39+
restore-keys: ${{ runner.os }}-m2
40+
41+
- name: Verify code format
42+
run: mvn -B spotless:check
43+
44+
- name: Compile, test and verify
45+
run: mvn -B verify -Ptest-coverage,code-analysis
46+
47+
- name: Analyze code with Sonar
48+
if: ${{ env.SONAR_TOKEN }} # the token is not available in Dependabot-triggered builds
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52+
run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

checkstyle-suppressions.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE suppressions PUBLIC
4+
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
5+
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
6+
7+
<suppressions>
8+
</suppressions>

0 commit comments

Comments
 (0)