templates for azure pipelines
I moved my stuff to github actions using https://github.com/asottile/workflows
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.5.2
this will make the templates in this repository available in the asottile
namespace.
job--python-tox.yml
new in v0.0.1
This job template will install python and invoke tox.
toxenvs
: the list of tox
environment names to runos
: choices (linux
, windows
, osx
)architectures
: new in v2.0.0 list with choices (x64
, x86
),[x64]
(only affects windows)coverage
: new in v0.0.7 after the run publish coverage to azuretrue
wheel_tags
: new in v0.0.10 after a run of a tag, build a wheel andfalse
. the artifacts can be downloadedbin/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[]
name_postfix
: new in v0.0.5 string to be appended to job name if you need''
The tox environments must either:
py37
, py38
, py39
, py310
, py311
, py312
, pypy3
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
- 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.
ruby
: the version of ruby to install to the system (used by some hooks),'>= 2.4'
python
: the python version to run pre-commit with, defaults to '3.7'
- 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
go_versions
: list of go versions to test againstos
: choices (linux
, windows
, macos
)tests
: what to go test ...
, default ./...
pre_test
: steps
to run before running tox
, such as installing tools,[]
name_postfix
: string to be appended to job name if you need to make it''
- template: job--go-test.yml@asottile
parameters:
go_versions: ['1.11.5', '1.12']
os: 'linux'
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
.
versions
: ref to install at, default HEAD
- template: step--install-git.yml