The cmake version of the shell!

My executor is shell.
Here is my .gitlab-ci.yml:
build-job:
stage: build
script:
- which cmake
- cmake --version

In my ubuntu 18.04, the cmake --version is :3.16;
But, in my .gitlab-ci.yml ,the cmake --version is :3.10;
I want to use cmake 3.16, so what should I do?
Please help me!

Hi @hunger_venus
you can use container image with cmake 3.16 installed or you can install it as part of the steps in script:

1 Like

You may not understand my mean.I use the shell as my gitlab-runner executor at present.Shell can use the environment of my local machine that has install the cmake (3.16).
In my local environment, the cmake’s version is :3.16;
In my .gitlab-ci.yml ,the cmake’s version is :3.10;

Thanks your commit.

Are you sure it is running on your Shell Runner? I don’t see tags: keyword in your job description.
If you are using gitlab.com the GitLab Shared Runners will pickup any untagged jobs.

I’m sure it is running on my Shell Runner.

According to official package list Ubuntu – Details of package cmake in bionic cmake 3.10 is latest version for ubuntu 18.04 bionic.
If you have installed another cmake on a custom path you need to setup the same for gitlab-runner user or specify absolute path to your cmake 3.16 in gitlab-ci.yml file

1 Like

OK, I’ll have a try.