gpt4 book ai didi

spring-boot - 减少 Gradle 的 Travis-CI 构建时间

转载 作者:行者123 更新时间:2023-12-03 05:05:00 25 4
gpt4 key购买 nike

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

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

除了一件事之外,一切似乎都完美无缺,我的项目目前是一个空的 SpringBoot 项目,其中包含(并且没有测试)并且构建本身占用了 2m(主要是由于安装 Gradle 所花费的时间)。

我在他们的网站上查看并看到了对构建的一些优化,但他们在项目的这个阶段很早就开始了(例如并行测试执行)。

我错过了什么吗? 2m 是 Travis-CI 构建时间的基线吗?

我目前对 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)

最佳答案

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

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

关于spring-boot - 减少 Gradle 的 Travis-CI 构建时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61039278/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com