Merge branch 'ci-ant-test' into 'master'

CI: add job to run tests with ant

See merge request i2p-hackers/i2p.i2p!21
This commit is contained in:
idk
2021-02-22 18:16:19 +00:00

View File

@ -4,14 +4,7 @@ stages:
- test - test
- build - build
cache: test:gradle:
key: ${CI_COMMIT_REF_SLUG}
paths:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- .gradle
test:
stage: test stage: test
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
before_script: before_script:
@ -20,6 +13,47 @@ test:
- ./gradlew codeCoverageReport - ./gradlew codeCoverageReport
# The actual output that will be parsed by the code coverage # The actual output that will be parsed by the code coverage
- grep -oP "Total.*?%" build/reports/jacoco/html/index.html - grep -oP "Total.*?%" build/reports/jacoco/html/index.html
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- .gradle
only:
- master
- merge_requests
- tags
test:ant:
stage: test
image: debian:buster-slim
variables:
SCALA: https://downloads.lightbend.com/scala/2.12.13/scala-2.12.13.deb
LIBPREFIX: /usr/share/scala/lib
LIB_SCALATEST: https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/3.0.4/scalatest_2.12-3.0.4.jar
LIB_SCALACTIC: https://repo1.maven.org/maven2/org/scalactic/scalactic_2.12/3.0.4/scalactic_2.12-3.0.4.jar
before_script:
# Fix bug installing openjdk-11-jdk-headless's manuals
- mkdir -p /usr/share/man/man1/
- apt-get update -q
- apt-get install -y wget gettext
ant default-jdk-headless
libmockito-java libhamcrest-java junit4
# Install specific version of scala
- wget -qO scala.deb "${SCALA}"
- dpkg -i scala.deb
# link to the scala libs with the name `ant test` expects
- ln -s "${LIBPREFIX}/scala-xml_2.12-1.0.6.jar" "${LIBPREFIX}/scala-xml.jar"
# Download required scala libs
- wget -qO "${LIBPREFIX}/scalactic.jar" "${LIB_SCALACTIC}"
- wget -qO "${LIBPREFIX}/scalatest.jar" "${LIB_SCALATEST}"
# Point ant to the right directories
- echo scalatest.libs=/usr/share/scala/lib > override.properties
- echo junit.home=/usr/share/java >> override.properties
- echo hamcrest.home=/usr/share/java >> override.properties
- echo mockito.home=/usr/share/java >> override.properties
script:
- ant test
only: only:
- master - master
- merge_requests - merge_requests