GitLab CI 为 Python 共享了 Windows 运行器 [英] GitLab CI shared Windows runner for Python

查看:42
本文介绍了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

这篇关于GitLab CI 为 Python 共享了 Windows 运行器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆