I have a .gitlab-ci.yml configuration file whose main purpose is to execute the unit tests of an Android project module. These unit tests are executed in my MacOS machine which I have set up to act as a specific runner. However the execution fails because I get the following error:
- What went wrong:
Task ‘check’ not found in project ‘:eamcomponents’.
I try to execute the unit tests of the module “eamcomponents”, which is a module inside my Android project, and the following command executes such unit tests:
./gradlew :eamcomponents:check
My “.gitlab-ci.yml” configuration file is:
before_script:
- export PATH=$PATH
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- unittest
uitest_job:
stage: unittest
script:
- ./gradlew :eamcomponents:check
tags:
- android
- osx_10-14
It is important to remark that I can execute successfully the command:
./gradlew :eamcomponents:check
using the command line in my Mac, and take into account that I have set up my Mac to be the runner of that GitLab project.
In addition I would like to comment the structure of my project: It consists of an “starter” project (with its build.gradle, -project) and inside that started project there are several modules (every one of them with its corresponding “build.gradle” -module), and one of those modules is the “eamcomponents” module; that is, the one I tried to run its unit tests.
Finally, the contents of my “.bash_profile” is:
eval “$(rbenv init -)”
export LC_ALL=en_US.UTF-8
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/"
export ANDROID_HOME=/Users/gcodinar/Library/Android/sdk
export PATH=$JAVA_HOME/bin:$PATH:$ANDROID_HOME/tools
In addition I have tried other commands like “lint” but I get the same error:
./gradlew :eamcomponents:lint
And the error is:
- What went wrong:
Task ‘lint’ not found in project ‘:eamcomponents’.