File tree Expand file tree Collapse file tree 2 files changed +31
-24
lines changed
Expand file tree Collapse file tree 2 files changed +31
-24
lines changed Original file line number Diff line number Diff line change 4040 - name : Run lint checks
4141 run : |
4242 mvn compiler:compile -Pdev,jdk11 -B -U -e
43+ check-format :
44+ if : github.event_name == 'pull_request'
45+ runs-on : ubuntu-latest
46+ container : centos:7
47+ steps :
48+ - name : Checkout repository
49+ uses : actions/checkout@v1
50+ - name : Install environment
51+ run : |
52+ yum -y update
53+ yum -y install centos-release-scl-rh epel-release
54+ yum -y install java-11-openjdk-devel devtoolset-7
55+ echo Downloading Maven
56+ curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -o $HOME/apache-maven-3.6.3-bin.tar.gz
57+ tar xzf $HOME/apache-maven-3.6.3-bin.tar.gz -C /opt/
58+ ln -sf /opt/apache-maven-3.6.3/bin/mvn /usr/bin/mvn
59+ - name : Build project
60+ run : |
61+ source scl_source enable devtoolset-7 || true
62+ export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac)))))
63+ echo $JAVA_HOME
64+ mvn -version
65+ mvn clean install -Pdev,jdk11 -B -U -e -Dlint.skip=true
66+ - name : Run format checks
67+ run : |
68+ mvn spotless:check -Pdev,jdk11 -B -U -e
4369 prepare :
4470 runs-on : ubuntu-latest
4571 outputs :
Original file line number Diff line number Diff line change 230230 </build >
231231 </profile >
232232
233+ <!--
234+ Profile that enables format checks on compilation
235+ Can auto-format using spotless:apply.
236+ -->
233237 <profile >
234- <id >format</id >
235- <activation >
236- <jdk >(,16)</jdk >
237- </activation >
238+ <id >check-format</id >
238239 <build >
239240 <plugins >
240241 <plugin >
340341 <googleJavaFormat />
341342
342343 <removeUnusedImports />
343-
344- <licenseHeader >
345- <content >
346- /* Copyright $YEAR The TensorFlow Authors. All Rights Reserved.
347-
348- Licensed under the Apache License, Version 2.0 (the "License");
349- you may not use this file except in compliance with the License.
350- You may obtain a copy of the License at
351-
352- http://www.apache.org/licenses/LICENSE-2.0
353-
354- Unless required by applicable law or agreed to in writing, software
355- distributed under the License is distributed on an "AS IS" BASIS,
356- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
357- See the License for the specific language governing permissions and
358- limitations under the License.
359- =======================================================================
360- */
361- </content >
362- </licenseHeader >
363344 </java >
364345 </configuration >
365346 </plugin >
You can’t perform that action at this time.
0 commit comments