GitLab CI 为 Python 共享了 Windows 运行器
问题描述:
我在 GitLab 中有一个 Python 项目存储库.我看到 GitLab 已经在测试版中共享了 Windows 运行器(参见 this 帖子).
I have a python project repo in GitLab. I saw that GitLab has shared Windows runner in beta version available (See this post).
我想知道是否有任何标准的 gitlab-ci.yml
用于 Windows 共享运行器上的 python?如果是这样,由于这仍然是测试版,我很好奇这有多稳定?对于那些使用过它并有使用 AppVeyor 经验的人,我使用 AppVeyor 还是这个更好?
I am wondering if there is any standard gitlab-ci.yml
for python on Windows shared runner? If so, since this is still beta version, I'm curious how stable is this? For those who have used this and have experience with AppVeyor, am I better off with AppVeyor or this?
谢谢!
答
你可以使用这个片段:
my_win_job:
before_script:
# https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/-/issues/13
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- choco install python3 --version=$PYTHON_VERSION --yes --force --no-progress
- refreshenv
script:
- python -V
- python -m pip install -U pip wheel
variables:
PYTHON_VERSION: "3.9"
tags:
- windows