项目作者: asottile

项目描述 :
templates for azure pipelines
高级语言: Python
项目地址: git://github.com/asottile/azure-pipeline-templates.git
创建时间: 2019-02-24T06:02:51Z
项目社区:https://github.com/asottile/azure-pipeline-templates

开源协议:

下载


DEPRECATED

I moved my stuff to github actions using https://github.com/asottile/workflows


Build Status
pre-commit.ci status

azure-pipeline-templates

usage

First configure a github service connection

It is suggested to use a generic name, such as github so forks can also
configure the same.

You can find this in Project Settings => Service connections in the
Azure Devops dashboard for your project. Project settings is located in the
bottom left corner of the UI as of 2019-03-07.

Below I’m using the endpoint name github

Next add this to the beginning of your azure-pipelines.yml

  1. resources:
  2. repositories:
  3. - repository: asottile
  4. type: github
  5. endpoint: github
  6. name: asottile/azure-pipeline-templates
  7. ref: refs/tags/v2.5.2

this will make the templates in this repository available in the asottile
namespace.

job templates

job--python-tox.yml

new in v0.0.1

This job template will install python and invoke tox.

parameters

  • toxenvs: the list of tox environment names to run
  • os: choices (linux, windows, osx)
  • architectures: new in v2.0.0 list with choices (x64, x86),
    default [x64] (only affects windows)
  • coverage: new in v0.0.7 after the run publish coverage to azure
    pipelines, default true
  • wheel_tags: new in v0.0.10 after a run of a tag, build a wheel and
    publish it as an artifact, default false. the artifacts can be downloaded
    using the bin/download-wheels script included in this repository.
  • additional_variables: new in v0.0.13 additional pipeline variables
  • pre_test: new in v0.0.5 steps to run before running tox, such as
    installing tools, etc. default: []
  • name_postfix: new in v0.0.5 string to be appended to job name if you need
    to make it unique, default: ''

The tox environments must either:

  • be equal to: py37, py38, py39, py310, py311, py312, pypy3
  • start with: py37-, py38-, py39-, py310-, py311-, py312-, pypy3-

for now, python3.12 is only available on linux — it is installed from
deadsnakes

coverage information can be displayed using a
shields.io badge

example

  1. - template: job--python-tox.yml@asottile
  2. parameters:
  3. toxenvs: [py27, py37]
  4. os: windows

job--pre-commit.yml

new in v0.0.2

This job template will invoke pre-commit against all
files.

parameters

  • ruby: the version of ruby to install to the system (used by some hooks),
    defaults to '>= 2.4'
  • python: the python version to run pre-commit with, defaults to '3.7'

example

  1. - template: job--pre-commit.yml@asottile

job--go-test.yml

new in v0.0.6

This job checks out a go project, runs go get and then go test

parameters

  • go_versions: list of go versions to test against
  • os: choices (linux, windows, macos)
  • tests: what to go test ..., default ./...
  • pre_test: steps to run before running tox, such as installing tools,
    etc. default: []
  • name_postfix: string to be appended to job name if you need to make it
    unique, default: ''

example

  1. - template: job--go-test.yml@asottile
  2. parameters:
  3. go_versions: ['1.11.5', '1.12']
  4. os: 'linux'

step templates

When referring to a step template as part of pre_test, omit the @asottile
repository selector (as the template is included after job templating).

step--git-install.yml

new in v0.0.8

This step template will install git from source and put it on the PATH.
This step is currently only supported on linux.

parameters

  • versions: ref to install at, default HEAD

example

  1. - template: step--install-git.yml