[CI] test complex CI

This commit is contained in:
Edouard DUPIN 2020-08-16 23:24:08 +02:00
parent cf1ed4ce54
commit fa5f3cdad0
2 changed files with 159 additions and 2 deletions

View File

@ -2,11 +2,15 @@ image: bellsoft/liberica-openjdk-alpine:latest
before_script:
- apk update && apk add apache-ant unzip wget openssh-client git
- git submodule sync --recursive
- git submodule update --init --recursive
- wget -O ~/javaFXSDK.zip http://gluonhq.com/download/javafx-14-sdk-linux/ -P ~
- unzip ~/javaFXSDK.zip -d ~/javaFXSDK
- ls ~/javaFXSDK/javafx-sdk-14/lib
- wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/1.5.2/junit-platform-console-standalone-1.5.2.jar -P ~
stages:
- style
- build
- test
ci_style:
stage: style
@ -15,3 +19,22 @@ ci_style:
- wget https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.34/checkstyle-8.34-all.jar -O checkstyle.jar
- java -jar checkstyle.jar -c CheckStyle.xml `find src/ -name "*.java"`
- java -jar checkstyle.jar -c CheckStyle.xml `find test/src/ -name "*.java"`
ci_build:
stage: build
script:
- export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
- eval echo "~$USER"
- cd core/
- ant clean
- ant build
ci_test:
stage: test
script:
- export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
- cd gui/
- ant clean build TestBasicLog
artifacts:
reports:
junit: junit/TEST-*.xml

134
build.xml Normal file
View File

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="scenarium-logger">
<property environment="env"/>
<property name="beanmanager.location" value="../beanmanager"/>
<property name="plugin-manager.location" value="../plugin-manager"/>
<property name="scenarium-base.location" value="../scenarium-base"/>
<property name="scenarium-core.location" value="../scenarium/core"/>
<property name="scenarium-river.location" value="../scenarium-river"/>
<property name="scenarium-run.location" value="../scenarium-run"/>
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="14"/>
<property name="source" value="14"/>
<path id="JUnit 5.libraryclasspath">
<pathelement location="${user.home}/junit-platform-console-standalone-1.5.2.jar"/>
</path>
<path id="scenarium-logger.classpath">
<pathelement location="bin/"/>
<pathelement location="test/bin"/>
<path refid="JUnit 5.libraryclasspath"/>
<pathelement location="test/lib/junit-toolbox-2.4.jar"/>
</path>
<path id="run.TestBasicLog.classpath">
<path refid="scenarium-logger.classpath"/>
<path refid="JUnit 5.libraryclasspath"/>
<pathelement location="test/lib/junit-toolbox-2.4.jar"/>
</path>
<target name="init">
<mkdir dir="bin/"/>
<mkdir dir="test/bin"/>
<copy includeemptydirs="false" todir="bin/">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy includeemptydirs="false" todir="test/bin">
<fileset dir="test/src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin/"/>
<delete dir="test/bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin/" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="scenarium-logger.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="test/bin" includeantruntime="false" source="${source}" target="${target}">
<src path="test/src"/>
<classpath refid="scenarium-logger.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects">
<ant antfile="build.xml" dir="${beanmanager.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${beanmanager.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${plugin-manager.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${plugin-manager.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${scenarium-base.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${scenarium-base.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${scenarium-core.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${scenarium-core.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${scenarium-river.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${scenarium-river.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="build.xml" dir="${scenarium-run.location}" inheritAll="false" target="clean"/>
<ant antfile="build.xml" dir="${scenarium-run.location}" inheritAll="false" target="build">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
</target>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="TestBasicLog">
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="test.scenarium.logger.TestBasicLog" todir="${junit.output.dir}"/>
<jvmarg line="-ea"/>
<classpath refid="run.TestBasicLog.classpath"/>
</junit>
</target>
<target name="junitreport">
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.output.dir}"/>
</junitreport>
</target>
</project>