Skip to content

Commit c0d619b

Browse files
Regzoxmarob
authored andcommitted
story #15307 ci: add license and linter checks
1 parent 911667a commit c0d619b

3 files changed

Lines changed: 29 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
java-version: "17"
2020

2121
- name: Build and Run Tests
22-
run: mvn --settings .ci/github-actions-settings.xml verify
22+
run: mvn --settings .ci/github-actions-settings.xml -Dspotless.check.skip verify
2323
env:
2424
JAVA_TOOL_OPTIONS: "-Duser.timezone=Europe/Paris"
2525
SERVICE_NEXUS_URL: ${{ secrets.SERVICE_NEXUS_URL }}

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
run-name: Linting branch ${{ github.ref }}
3+
on: [push, pull_request]
4+
jobs:
5+
lint-java:
6+
name: Lint Java
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-java@v4
11+
with:
12+
distribution: "temurin"
13+
java-version: "21"
14+
- name: Restore maven cache
15+
uses: actions/cache@v4
16+
with:
17+
path: |
18+
~/.m2/repository
19+
**/target/spotless-prettier-node-modules-*
20+
key: maven-lint-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
21+
- name: License and Format Check
22+
run: mvn --settings .ci/github-actions-settings.xml -Pvitam -T1C license:check spotless:check
23+
env:
24+
SERVICE_NEXUS_URL: ${{ secrets.SERVICE_NEXUS_URL }}
25+
CI_USR: ${{ secrets.CI_USR }}
26+
CI_PSW: ${{ secrets.CI_PSW }}

pom.xml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -182,33 +182,16 @@
182182
<artifactId>versions-maven-plugin</artifactId>
183183
<version>${versions.version}</version>
184184
</plugin>
185-
<!-- Directory plugin to find parent root directory absolute path -->
186-
<plugin>
187-
<groupId>org.commonjava.maven.plugins</groupId>
188-
<artifactId>directory-maven-plugin</artifactId>
189-
<version>0.1</version>
190-
<executions>
191-
<execution>
192-
<id>directories</id>
193-
<goals>
194-
<goal>highest-basedir</goal>
195-
</goals>
196-
<phase>initialize</phase>
197-
<configuration>
198-
<property>main.basedir</property>
199-
</configuration>
200-
</execution>
201-
</executions>
202-
</plugin>
203185
</plugins>
204186
</pluginManagement>
205187
<plugins>
206188
<plugin>
207189
<groupId>com.mycila</groupId>
208190
<artifactId>license-maven-plugin</artifactId>
209191
<version>${license-maven-plugin.version}</version>
192+
<inherited>false</inherited>
210193
<configuration>
211-
<header>${maven.multiModuleProjectDirectory}/LICENSE.txt</header>
194+
<header>LICENSE.txt</header>
212195
<properties>
213196
<owner>Vitam</owner>
214197
<email>contact@programmevitam.fr</email>

0 commit comments

Comments
 (0)