I\'m using .gitlab-ci.yml and docker as a GitLab CI runner on an Android project. At the end of the test run, gradlew saves test results in xml and
I would advice against mounting volumes from the host for your CI.
If you really want to, you have to configure the runner accordingly (config.toml).
If you are using shared runners you never know on what system a particular build is going to be executed.
I think the better solution would be to define the test-results as artifacts.
That way, the test-results are available for older builds and not only the latest build.
Below you can find the configuration (config.toml) of my runner I use for building docker-images. You can replace /var/run/docker.sock by the directory you want your build-results to end up in.
[[runners]]
name = "Docker"
url = "https://mygitlab/ci"
token = "mytoken"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:latest"
privileged = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
[runners.cache]
Insecure = false