减少Gradle的Travis-CI建立时间

问题描述 投票:0回答:1

我已经开始了SprintBoot和Kotlin的新项目,我想使用Travis-CI作为CI服务器。

我也想使用codecov来收集有关我的代码覆盖率的报告

一切似乎都可以正常工作,我的项目当前是一个空的SpringBoot项目,其中包含(没有测试),并且构建本身最多需要2m(主要是由于安装Gradle所需的时间)。

[我检查了他们的网站,看到了对构建的一些优化,但他们希望在项目的此阶段尽早(例如并行测试执行)。

我想念什么吗? Travis-CI的建造时间基线是2m?

我对Travis的当前配置:

# This enables the 'defaults' to test java applications:
language: java

# We can specify a list of JDKs to be used for testing
# A list of available JDKs in Trusty can be seed in:
# https://docs.travis-ci.com/user/reference/xenial/#jvm-clojure-groovy-java-scala-support
jdk:
  - openjdk11

before_script:
  # makes sure that gradle commands can be executed on build
  - chmod +x gradlew

script:
  # Makes sure that gradle can be executed.
  - ./gradlew check
  # Generates the reports for codecov
  - ./gradlew jacocoTestReport

# This is to enable CodeCov's coverage
# If a build is successful, the code is submitted for coverage analysis
after_success:
  - bash <(curl -s https://codecov.io/bash)
spring-boot gradle kotlin travis-ci
1个回答
0
投票

您需要缓存以提高在Travis上构建文件的速度。 Gradle有专门的关于在Travis上进行构建的指南:https://guides.gradle.org/executing-gradle-builds-on-travisci/

对于缓存,向下滚动到Enable caching of downloaded artifacts

© www.soinside.com 2019 - 2024. All rights reserved.