circleci congif.yml文件-我需要实现checkstylemain和checkstyletest的连续集成-以下是我的相关文件:

jm81lzqq  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(181)

这是我需要调整的config.yml,以便不仅在出现新的pull请求(已经完成)时运行测试,而且运行mainapp和测试的checkstyles。我正在java11上运行这个应用程序。谁能给我一些关于如何调整那个文件的建议吗?我几乎不了解其中的任何内容,因为我一直只关注java。


# Java Gradle CircleCI 2.0 configuration file

# 

# Check https://circleci.com/docs/2.0/language-java/ for more details

# 

version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/openjdk:11-jdk

      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/postgres:9.4

    working_directory: ~/repo

    environment:
      # Customize the JVM maximum heap limit
      JVM_OPTS: -Xmx3200m
      TERM: dumb

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
            - v1-dependencies-{{ checksum "build.gradle" }}
            # fallback to using the latest cache if no exact match is found
            - v1-dependencies-

      - run: gradle dependencies

      - save_cache:
          paths:
            - ~/.gradle
          key: v1-dependencies-{{ checksum "build.gradle" }}

      # run tests!
      - run: gradle test

这是我的build.gradle文件:

plugins {
    id 'org.springframework.boot' version '2.4.0'
    id 'io.spring.dependency-management' version '1.0.10.RELEASE'
    id 'java'
}

apply plugin: 'checkstyle'
checkstyle {
    toolVersion "8.18"
}

group = 'com.gattoverde-tribes'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation('org.springframework.boot:spring-boot-starter-test',
            'org.springframework.security:spring-security-test')
    runtimeOnly('org.springframework.boot:spring-boot-devtools',
            'com.h2database:h2',
            'mysql:mysql-connector-java')
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    compileOnly 'org.projectlombok:lombok'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
    implementation 'junit:junit:4.12'
    implementation 'com.liferay:javax.xml.bind:2.3.0.LIFERAY-PATCHED-2'
    implementation 'org.springframework.boot:spring-boot-starter'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题