azure-pipeline-templates
azure-pipeline-templates copied to clipboard
templates for azure pipelines
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
resources:
repositories:
- repository: asottile
type: github
endpoint: github
name: asottile/azure-pipeline-templates
ref: refs/tags/v2.4.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 oftoxenvironment names to runos: 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, defaulttruewheel_tags: new in v0.0.10 after a run of a tag, build a wheel and publish it as an artifact, defaultfalse. the artifacts can be downloaded using thebin/download-wheelsscript included in this repository.additional_variables: new in v0.0.13 additional pipelinevariablespre_test: new in v0.0.5stepsto run before runningtox, 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:
py27,py36,py37,py38,py39,py310,py311 - start with:
py27-,py36-,py37-,py38-,py39-,py310-,py311-
for now, python3.11 is only available on linux -- it is installed from deadsnakes
coverage information can be displayed using a shields.io badge
example
- template: job--python-tox.yml@asottile
parameters:
toxenvs: [py27, py37]
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
- 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 againstos: choices (linux,windows,macos)tests: what togo test ..., default./...pre_test:stepsto run before runningtox, such as installing tools, etc. default:[]name_postfix: string to be appended to job name if you need to make it unique, default:''
example
- template: job--go-test.yml@asottile
parameters:
go_versions: ['1.11.5', '1.12']
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, defaultHEAD
example
- template: step--install-git.yml