Skip to content

Commit 1681588

Browse files
committed
static-code-analysis mvn profile
1 parent d253842 commit 1681588

File tree

2 files changed

+83
-76
lines changed

2 files changed

+83
-76
lines changed

.github/workflows/maven.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -210,26 +210,23 @@ jobs:
210210
- name: Test
211211
run: mvn --no-transfer-progress -am -pl driver test -Djackson.version=${{matrix.jackson-version}}
212212

213-
sonar:
214-
timeout-minutes: 10
213+
shaded-integration-tests:
214+
timeout-minutes: 20
215215
runs-on: ubuntu-latest
216216

217217
strategy:
218218
fail-fast: false
219219
matrix:
220220
docker-img:
221-
- docker.io/arangodb/enterprise:3.10.1
221+
- docker.io/arangodb/arangodb:3.10.1
222222
topology:
223+
- single
223224
- cluster
224-
db-ext-names:
225-
- false
226225
java-version:
227-
- 11
226+
- 17
228227

229228
steps:
230229
- uses: actions/checkout@v2
231-
with:
232-
fetch-depth: 0
233230
- name: Set up JDK
234231
uses: actions/setup-java@v2
235232
with:
@@ -239,41 +236,39 @@ jobs:
239236
- name: Start Database
240237
run: ./docker/start_db.sh
241238
env:
242-
ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }}
243239
STARTER_MODE: ${{matrix.topology}}
244240
DOCKER_IMAGE: ${{matrix.docker-img}}
245-
DATABASE_EXTENDED_NAMES: ${{matrix.db-ext-names}}
246241
- name: Info
247242
run: mvn -version
248-
- name: Cache SonarCloud packages
249-
uses: actions/cache@v1
250-
with:
251-
path: ~/.sonar/cache
252-
key: ${{ runner.os }}-sonar
253-
restore-keys: ${{ runner.os }}-sonar
254-
- name: Build and analyze
255-
env:
256-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
257-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
258-
run: mvn -B --no-transfer-progress -Dgpg.skip=true -am -pl driver verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=arangodb_arangodb-java-driver
243+
- name: Install
244+
run: mvn --no-transfer-progress install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true
245+
- name: Test jackson-serde
246+
working-directory: shaded-integration-tests
247+
run: mvn --no-transfer-progress -P jackson-serde test
248+
- name: Test jsonb-serde
249+
working-directory: shaded-integration-tests
250+
run: mvn --no-transfer-progress -P jsonb-serde test
259251

260-
shaded-integration-tests:
261-
timeout-minutes: 20
252+
sonar:
253+
timeout-minutes: 10
262254
runs-on: ubuntu-latest
263255

264256
strategy:
265257
fail-fast: false
266258
matrix:
267259
docker-img:
268-
- docker.io/arangodb/arangodb:3.10.1
260+
- docker.io/arangodb/enterprise:3.10.1
269261
topology:
270-
- single
271262
- cluster
263+
db-ext-names:
264+
- false
272265
java-version:
273-
- 17
266+
- 11
274267

275268
steps:
276269
- uses: actions/checkout@v2
270+
with:
271+
fetch-depth: 0
277272
- name: Set up JDK
278273
uses: actions/setup-java@v2
279274
with:
@@ -283,15 +278,20 @@ jobs:
283278
- name: Start Database
284279
run: ./docker/start_db.sh
285280
env:
281+
ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }}
286282
STARTER_MODE: ${{matrix.topology}}
287283
DOCKER_IMAGE: ${{matrix.docker-img}}
284+
DATABASE_EXTENDED_NAMES: ${{matrix.db-ext-names}}
288285
- name: Info
289286
run: mvn -version
290-
- name: Install
291-
run: mvn --no-transfer-progress install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true
292-
- name: Test jackson-serde
293-
working-directory: shaded-integration-tests
294-
run: mvn --no-transfer-progress -P jackson-serde test
295-
- name: Test jsonb-serde
296-
working-directory: shaded-integration-tests
297-
run: mvn --no-transfer-progress -P jsonb-serde test
287+
- name: Cache SonarCloud packages
288+
uses: actions/cache@v1
289+
with:
290+
path: ~/.sonar/cache
291+
key: ${{ runner.os }}-sonar
292+
restore-keys: ${{ runner.os }}-sonar
293+
- name: Build and analyze
294+
env:
295+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
296+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
297+
run: mvn -Pstatic-code-analysis -B --no-transfer-progress -Dgpg.skip=true -am -pl driver verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=arangodb_arangodb-java-driver

driver/pom.xml

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,55 @@
8383
</plugins>
8484
</build>
8585
</profile>
86+
<profile>
87+
<id>static-code-analysis</id>
88+
<build>
89+
<plugins>
90+
<plugin>
91+
<groupId>org.jacoco</groupId>
92+
<artifactId>jacoco-maven-plugin</artifactId>
93+
<version>0.8.8</version>
94+
<executions>
95+
<execution>
96+
<goals>
97+
<goal>prepare-agent</goal>
98+
</goals>
99+
</execution>
100+
<execution>
101+
<id>report</id>
102+
<phase>prepare-package</phase>
103+
<goals>
104+
<goal>report</goal>
105+
</goals>
106+
</execution>
107+
</executions>
108+
</plugin>
109+
<plugin>
110+
<groupId>com.github.spotbugs</groupId>
111+
<artifactId>spotbugs-maven-plugin</artifactId>
112+
<version>4.7.3.0</version>
113+
<configuration>
114+
<excludeFilterFile>spotbugs/spotbugs-exclude.xml</excludeFilterFile>
115+
</configuration>
116+
<executions>
117+
<execution>
118+
<phase>compile</phase>
119+
<goals>
120+
<goal>check</goal>
121+
</goals>
122+
</execution>
123+
</executions>
124+
<dependencies>
125+
<dependency>
126+
<groupId>com.github.spotbugs</groupId>
127+
<artifactId>spotbugs</artifactId>
128+
<version>4.7.3</version>
129+
</dependency>
130+
</dependencies>
131+
</plugin>
132+
</plugins>
133+
</build>
134+
</profile>
86135
</profiles>
87136

88137
<build>
@@ -129,48 +178,6 @@
129178
</execution>
130179
</executions>
131180
</plugin>
132-
<plugin>
133-
<groupId>org.jacoco</groupId>
134-
<artifactId>jacoco-maven-plugin</artifactId>
135-
<version>0.8.8</version>
136-
<executions>
137-
<execution>
138-
<goals>
139-
<goal>prepare-agent</goal>
140-
</goals>
141-
</execution>
142-
<execution>
143-
<id>report</id>
144-
<phase>prepare-package</phase>
145-
<goals>
146-
<goal>report</goal>
147-
</goals>
148-
</execution>
149-
</executions>
150-
</plugin>
151-
<plugin>
152-
<groupId>com.github.spotbugs</groupId>
153-
<artifactId>spotbugs-maven-plugin</artifactId>
154-
<version>4.7.3.0</version>
155-
<configuration>
156-
<excludeFilterFile>spotbugs/spotbugs-exclude.xml</excludeFilterFile>
157-
</configuration>
158-
<executions>
159-
<execution>
160-
<phase>compile</phase>
161-
<goals>
162-
<goal>check</goal>
163-
</goals>
164-
</execution>
165-
</executions>
166-
<dependencies>
167-
<dependency>
168-
<groupId>com.github.spotbugs</groupId>
169-
<artifactId>spotbugs</artifactId>
170-
<version>4.7.3</version>
171-
</dependency>
172-
</dependencies>
173-
</plugin>
174181
<plugin>
175182
<groupId>org.apache.maven.plugins</groupId>
176183
<artifactId>maven-enforcer-plugin</artifactId>

0 commit comments

Comments
 (0)