2222 with :
2323 product : opensearch
2424
25+ spotless :
26+ steps :
27+ - uses : actions/checkout@v4
28+ # Spotless requires JDK 17+
29+ - name : Setup Java 21
30+ uses : actions/setup-java@v1
31+ with :
32+ java-version : 21
33+ - name : Spotless Check
34+ run : ./gradlew spotlessCheck
35+
2536 Build-ml-linux :
26- needs : [Get-Require-Approval, Get-CI-Image-Tag]
37+ needs : [Get-Require-Approval, Get-CI-Image-Tag, spotless ]
2738 strategy :
2839 matrix :
2940 java : [21]
6677 export COHERE_KEY=`aws secretsmanager get-secret-value --secret-id github_cohere_key --query SecretString --output text` &&
6778 echo "::add-mask::$OPENAI_KEY" &&
6879 echo "::add-mask::$COHERE_KEY" &&
69- echo "build and run tests" && ./gradlew build &&
70- echo "Publish to Maven Local" && ./gradlew publishToMavenLocal &&
71- echo "Multi Nodes Integration Testing" && ./gradlew integTest -PnumNodes=3'
80+ echo "build and run tests" && ./gradlew build -x spotlessJava &&
81+ echo "Publish to Maven Local" && ./gradlew publishToMavenLocal -x spotlessJava &&
82+ echo "Multi Nodes Integration Testing" && ./gradlew integTest -PnumNodes=3 -x spotlessJava '
7283 plugin=`basename $(ls plugin/build/distributions/*.zip)`
7384 echo $plugin
7485 mv -v plugin/build/distributions/$plugin ./
8899
89100
90101 Test-ml-linux-docker :
91- needs : [Get-Require-Approval, Build-ml-linux]
102+ needs : [Get-Require-Approval, Build-ml-linux, spotless ]
92103 strategy :
93104 matrix :
94105 java : [21]
@@ -172,10 +183,10 @@ jobs:
172183 if [ $security -gt 0 ]
173184 then
174185 echo "Security plugin is available"
175- ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=${{ steps.genpass.outputs.password }}
186+ ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=${{ steps.genpass.outputs.password }} -x spotlessJava
176187 else
177188 echo "Security plugin is NOT available"
178- ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster"
189+ ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -x spotlessJava
179190 fi
180191
181192 - name : Upload Coverage Report
@@ -190,7 +201,7 @@ jobs:
190201 java : [21]
191202 name : Build and Test MLCommons Plugin on Windows
192203 if : github.repository == 'opensearch-project/ml-commons'
193- needs : [Get-Require-Approval]
204+ needs : [Get-Require-Approval, spotless ]
194205 environment : ${{ needs.Get-Require-Approval.outputs.is-require-approval }}
195206 runs-on : windows-latest
196207
@@ -218,10 +229,10 @@ jobs:
218229 export COHERE_KEY=$(aws secretsmanager get-secret-value --secret-id github_cohere_key --query SecretString --output text)
219230 echo "::add-mask::$OPENAI_KEY"
220231 echo "::add-mask::$COHERE_KEY"
221- ./gradlew.bat build
232+ ./gradlew.bat build -x spotlessJava
222233 - name : Publish to Maven Local
223234 run : |
224- ./gradlew publishToMavenLocal
235+ ./gradlew publishToMavenLocal -x spotlessJava
225236# - name: Multi Nodes Integration Testing
226237# shell: bash
227238# run: |
0 commit comments