GitLab CI Windows runner: What is available? How to install? Examples?

Finally I have managed to use the Shared Windows runner on GitLab.com using this config file.

test_windows:
    stage: test
    tags:
      - shared-windows
    script:
      - dir

However I am not a regular Windows user so I have no idea how to proceed and I could not find the information on the docs site of GitLab.

  • Is there a place that describes what is available on this runner?
  • How can I download and install anything on this machine? (e.g. Python, Ruby, or Perl?)
  • Do you use A Windows runner on a public repository? Could you link to your repository so I can learn from it?

A few answers:

Is there a place that describes what is available on this runner?

From the announcement blog entry you can find a list of all pre-included software for Windows containers (on GitLab.com) maintained here: https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/-/tree/master/cookbooks/preinstalled-software

How can I download and install anything on this machine? (e.g. Python, Ruby, or Perl?)

The containers use PowerShell to execute any passed scripts. Certain installers, such as Python’s Windows Installers, allow for customization and headless install (even without administrator privileges): https://stackoverflow.com/a/52578838/14595652 and https://docs.python.org/3.6/using/windows.html#installing-without-ui

Likewise, you can also find binary archives (often also called portable apps?) and extract and use them right after download (without needing to perform a formal Windows package install).

Do you use A Windows runner on a public repository? Could you link to your repository so I can learn from it?

I’ve not tried it, but a Windows-using .NET example appears available in the CI templates collection: https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/lib/gitlab/ci/templates/dotNET.gitlab-ci.yml

2 Likes