-
Notifications
You must be signed in to change notification settings - Fork 14
Setting up CI
Continuous Integration (CI) is very useful for testing the application. We use the GitLab CI facilities to test the application on Unix and Windows systems. The setup is only described for GitLab, but should be similar and straightforward for any other hosting service like GitHub.
For a Unix environment we recommend to use Docker. When Docker is installed, simply pull our docker build:
sudo docker pull timoguehring/droidmatedockerenv:latest
If you don't want to use Docker, you can have a look at the setup at our Docker repository.
Until now, we don't use Docker for Windows, because it seemed to be unstable. Therefore, we recommend to do the setup manually. Follow for this original requirements.
In order to use CI for GitLab a file named .gitlab-ci.yml
has to be placed in the root folder. Our configuration looks like this:
image: timoguehring/droidmatedockerenv:latest
stages:
- test
unitTestsUnix:
stage: test
tags:
- droidmate
script:
- chmod +x ./gradlew
- echo "Running unit tests on Unix"
- ./gradlew test
unitTestsWindows:
stage: test
tags:
- droidmatewin
script:
- echo "Running unit tests on Windows"
- .\gradlew test
unitTestsUnix
is tagged with droidmate
and unitTestsWindows
is tagged with droidmatewin
. With this setup we can distinguish between the tests on Unix and Windows systems. The GitLab CI needs runners to execute the configuration. Follow for this the manual for installing and registering on the appropriate systems: https://docs.gitlab.com/runner/
Note: Different GitLab versions support different setups for CI.
Under your GitLab repository > Settings
> CI / CD
> Runners settings
> Setup a specific Runner manually
, you can find the necessary URL and registration token.
- Enter as requested tag
droidmate
. - Enter as requested runner executor
docker
, if you followed the prerequisite setup. - Enter as requested docker image
timoguehring/droidmatedockerenv:latest
, if you chose docker as runner executor.
- Enter as requested tag
droidmatewin
. - Enter as requested runner executor
shell
, if you followed the prerequisite setup.
Make sure the runner services started.