首页 > 解决方案 > CircleCI 在运行 make 命令时出错

问题描述

我想 config.yml 具有“构建”和“测试”作业。我们Makefile的 docker 映像中有一个,但似乎找不到 make 文件,因为我总是收到此错误

#!/bin/bash -eo pipefail
make test
make: *** No rule to make target 'test'.  Stop.

Exited with code exit status 2
CircleCI received exit code 2

有人熟悉这个吗?我不确定我错过了什么。谢谢!

这是 yml 文件:

version: 2.1
workflows:
  my-workflow:
    jobs:
      - build:
          context: circleci-aws-credentials
      - test

jobs:
  build:
    docker:
      - image: circleci/openjdk:11-jdk

    working_directory: ~/my-project

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

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          key: my-project-service-{{ checksum "./build.gradle" }}

  test:
    docker:
      - image: circleci/openjdk:11-jdk

    working_directory: ~/my-project

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

    steps:
      - run:
          name: Gradle test
          command: make test
      - store_test_results:
          path: ./build/test-results

提前谢谢你的帮助!

标签: makefileyamlcircleci

解决方案


推荐阅读