Skip to content

Commit ba15f64

Browse files
committed
[GHA] Move style checks to separate job
Signed-off-by: Stefan Marr <[email protected]>
1 parent c78a3af commit ba15f64

File tree

2 files changed

+40
-93
lines changed

2 files changed

+40
-93
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,44 @@ name: Tests
33
on: [push, pull_request]
44

55
jobs:
6+
style:
7+
runs-on: ubuntu-24.04
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
12+
- name: Setup MX
13+
run: |
14+
./som --setup mx
15+
echo "PATH=$PATH:`pwd`/../mx" >> "$GITHUB_ENV"
16+
17+
- name: Get LabsJDK
18+
run: |
19+
./som --setup labsjdk
20+
21+
- name: Download Eclipse
22+
run: |
23+
export ECLIPSE_TAR=eclipse.tar.gz
24+
export ECLIPSE_URL=https://archive.eclipse.org/eclipse/downloads/drops4/R-4.30-202312010110/eclipse-SDK-4.30-linux-gtk-x86_64.tar.gz
25+
curl -L ${ECLIPSE_URL} -o ${ECLIPSE_TAR}
26+
tar --warning=no-unknown-keyword -C ${GITHUB_WORKSPACE}/.. -xzf ${ECLIPSE_TAR}
27+
28+
- name: Install Black and PyLint
29+
run: |
30+
pip install black pylint==2.4
31+
32+
- name: Run Style Gate
33+
run: |
34+
export ECLIPSE_EXE=${GITHUB_WORKSPACE}/../eclipse/eclipse
35+
export JAVA_HOME=$JAVA_HOME_21_X64
36+
mx --java-home=${JAVA_HOME} gate --tags style
37+
38+
- name: Lint Kompos
39+
run: |
40+
cd tools/kompos
41+
npm install
42+
npm run verify
43+
644
test_som:
745
strategy:
846
fail-fast: false # we want all jobs to run, because they may fail independently
@@ -17,9 +55,6 @@ jobs:
1755
- os: ubuntu-24.04
1856
job: test-2
1957

20-
- os: ubuntu-24.04
21-
job: lint
22-
2358
runs-on: ubuntu-24.04 # ubuntu-latest
2459
steps:
2560
- name: Checkout
@@ -38,7 +73,6 @@ jobs:
3873
./som --setup labsjdk
3974
4075
- name: Compile SOMns
41-
if: matrix.job != 'lint'
4276
run: |
4377
mx build
4478
@@ -49,7 +83,6 @@ jobs:
4983
mx tests-som
5084
5185
- name: SOMns Test Suite
52-
if: matrix.job != 'lint'
5386
run: |
5487
export JAVA_HOME=$JAVA_HOME_17_X64
5588
./som -G core-lib/TestSuite/TestRunner.ns
@@ -92,36 +125,8 @@ jobs:
92125
export JAVA_HOME=$JAVA_HOME_17_X64
93126
./tests/replay/test.sh 2
94127
95-
# Disabled due to breaking changes in the tracing infrastructure. Not fixed to make merge of Snapshotting PR(#293) easier.
96-
#- name: Snapshot Tests
128+
# Disabled due to breaking changes in the tracing infrastructure. Not fixed to make merge of Snapshotting PR(#293) easier.
129+
#- name: Snapshot Tests
97130
# script:
98131
# - run ./tests/snapshot/test.sh
99132
# - $ANT serialization-tests
100-
101-
102-
- name: CheckStyle
103-
if: matrix.job == 'lint'
104-
run: |
105-
ant -e checkstyle
106-
107-
- name: Download Eclipse
108-
if: matrix.job == 'lint'
109-
run: |
110-
export ECLIPSE_TAR=eclipse.tar.gz
111-
export ECLIPSE_URL=https://mirror.dkm.cz/eclipse/eclipse/downloads/drops4/R-4.25-202208311800/eclipse-SDK-4.25-linux-gtk-x86_64.tar.gz
112-
curl ${ECLIPSE_URL} -o ${ECLIPSE_TAR}
113-
tar -C ${GITHUB_WORKSPACE}/.. -xzf ${ECLIPSE_TAR}
114-
115-
- name: Check Eclipse Format
116-
if: matrix.job == 'lint'
117-
run: |
118-
export ECLIPSE_EXE=${GITHUB_WORKSPACE}/../eclipse/eclipse
119-
export JAVA_HOME=$JAVA_HOME_17_X64
120-
ant -e eclipseformat-check
121-
122-
- name: Lint Kompos
123-
if: matrix.job == 'lint'
124-
run: |
125-
cd tools/kompos
126-
npm install
127-
npm run verify

build.xml

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ kernel: ${kernel}</echo>
3535
<property name="svm.build" location="${svm.dir}/mxbuild/dists" />
3636
<property name="truffle.build" location="${truffle.dir}/mxbuild/dists" />
3737
<property name="somns-deps.version" value="0.3.7" />
38-
<property name="checkstyle.version" value="8.36" />
3938
<property name="jacoco.version" value="0.8.8" />
4039
<property name="affinity.version" value="3.23.2" />
4140
<property name="jna.version" value="5.12.1" />
@@ -222,63 +221,6 @@ kernel: ${kernel}</echo>
222221
dest="${lib.dir}/somns-deps-source.jar" />
223222
</target>
224223

225-
<target name="eclipseformat">
226-
<pathconvert pathsep=" " property="javafiles">
227-
<fileset dir="${src.dir}">
228-
<include name="**/*.java"/>
229-
</fileset>
230-
<fileset dir="${unit.dir}">
231-
<include name="**/*.java"/>
232-
</fileset>
233-
<fileset dir="${corelib.dir}">
234-
<include name="**/*.java"/>
235-
</fileset>
236-
</pathconvert>
237-
<exec executable="${env.ECLIPSE_EXE}" dir="${basedir}">
238-
<arg value="-nosplash"/>
239-
<arg value="-application"/>
240-
<arg value="-consolelog"/>
241-
<arg value="-data"/>
242-
<arg value="${basedir}"/>
243-
<arg value="-vm"/>
244-
<arg value="${env.JAVA_HOME}/bin/java"/>
245-
<arg value="org.eclipse.jdt.core.JavaCodeFormatter"/>
246-
<arg value="-config"/>
247-
<arg value="${basedir}/.settings/org.eclipse.jdt.core.prefs"/>
248-
<arg line="${javafiles}"/>
249-
</exec>
250-
</target>
251-
252-
<target name="eclipseformat-check" depends="eclipseformat">
253-
<exec executable="git" dir="${basedir}">
254-
<arg value="status" />
255-
<arg value="*.java" />
256-
</exec>
257-
<exec executable="git" dir="${basedir}" failonerror="true">
258-
<arg value="diff-index" />
259-
<arg value="--quiet" />
260-
<arg value="--exit-code" />
261-
<arg value="--ignore-submodules" />
262-
<arg value="HEAD" />
263-
</exec>
264-
</target>
265-
266-
<target name="checkstyle-jar">
267-
<get src="https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${checkstyle.version}/checkstyle-${checkstyle.version}-all.jar"
268-
usetimestamp="true"
269-
dest="${lib.dir}/checkstyle-${checkstyle.version}-all.jar" />
270-
</target>
271-
272-
<target name="checkstyle" depends="checkstyle-jar" description="Check Code with Checkstyle">
273-
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" classpath="${lib.dir}/checkstyle-${checkstyle.version}-all.jar" />
274-
<checkstyle config=".checkstyle_checks.xml">
275-
<fileset dir="${src.dir}" includes="**/*.java"/>
276-
<fileset dir="${unit.dir}" includes="**/*.java"/>
277-
<fileset dir="${corelib.dir}" includes="**/*.java"/>
278-
<formatter type="plain"/>
279-
</checkstyle>
280-
</target>
281-
282224
<target name="jacoco-lib" description="Get JaCoCo dependency">
283225
<get src="https://repo1.maven.org/maven2/org/jacoco/jacoco/${jacoco.version}/jacoco-${jacoco.version}.zip"
284226
usetimestamp="true"

0 commit comments

Comments
 (0)