使用 GitHub 操作运行 CI 时,构建任务和验证任务在根项目中不可用

Build tasks and Verification tasks not available in root project when runnig CI with GitHub action

我正在尝试 运行 CI 使用 Github 操作为包含 java 模块的多项目构建,但不断得到 task ‘clean’ not found in root project ‘${rootProjectName}’。当我将 ./gradlew tasks 添加到工作流时,输出不包括构建和验证任务。在我的本地机器上一切正常。请参阅下面的输出:

Tasks runnable from root project 'bank-transaction-analyzer'
------------------------------------------------------------

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'bank-transaction-analyzer'.
dependencies - Displays all dependencies declared in root project 'bank-transaction-analyzer'.
dependencyInsight - Displays the insight into a specific dependency in root project 'bank-transaction-analyzer'.
help - Displays a help message.
javaToolchains - Displays the detected java toolchains. [incubating]
outgoingVariants - Displays the outgoing variants of root project 'bank-transaction-analyzer'.
projects - Displays the sub-projects of root project 'bank-transaction-analyzer'.
properties - Displays the properties of root project 'bank-transaction-analyzer'.
tasks - Displays the tasks runnable from root project 'bank-transaction-analyzer'.

To see all tasks and more detail, run gradlew tasks --all

To see more detail about a task, run gradlew help --task <task>

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 40s
1 actionable task: 1 executed

Github_action.yml

name: CI-Quality

on: pull_request

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - run: chmod +x ./gradlew
      - run: ./gradlew tasks
      - run: ./gradlew clean check
      - run: ./gradlew assemble

从 .gitignore

中删除 settings.gradle