-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-template-tox-job.yml
97 lines (94 loc) · 3.51 KB
/
azure-template-tox-job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File: azure-template-tox-job.yml
# Date: 30-May-2024
#
##
parameters:
tox: ""
python: ""
os: "linux"
fixtures: ""
jobs:
- job: ${{ format('build_test_{0}_{1}', parameters.tox, parameters.os) }}
timeoutInMinutes: 0
pool:
${{ if eq(parameters.os, 'macos') }}:
vmImage: 'macOS-13'
${{ if eq(parameters.os, 'linux') }}:
vmImage: 'ubuntu-20.04'
variables:
- group: py-shared-variables
steps:
#
# ensure the required Python versions are available
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.python }}
addToPath: true
displayName: setup python
#
- checkout: self
submodules: true
#
- ${{ if startsWith(parameters.os, 'macos') }}:
- bash: |
set -e
ls -la /Applications/Xcode*
sudo xcode-select --switch /Applications/Xcode_14.2.app/Contents/Developer
which g++
c++ --version
displayName: "setup Xcode"
# ----------------------------------------------
- ${{ if startsWith(parameters.os, 'linux') }}:
- script: which apt
displayName: 'Installing OS dependencies'
- script: apt-cache policy | grep http | awk '{print $2 $3}' | sort -u
displayName: 'Checking for repos'
#
- script: "python -c \"import sys; print(sys.version); print(sys.executable)\""
displayName: show python information
#
- script: python -m pip install --upgrade pip tox
displayName: 'Install tools'
#
- script: pip install -r requirements.txt
displayName: 'Install dependencies'
#
- ${{ if startsWith(parameters.tox, 'py') }}:
- script: |
export CONFIG_SUPPORT_TOKEN_ENV=$(VAR_CONFIG_SUPPORT_TOKEN_ENV)
${{ format('python -m tox -e {0}', parameters.tox) }}
displayName: 'Running tox task'
- ${{ if and(not(startsWith(parameters.tox, 'py')), startsWith(parameters.python, '3.9')) }}:
- script: |
export CONFIG_SUPPORT_TOKEN_ENV=$(VAR_CONFIG_SUPPORT_TOKEN_ENV)
${{ format('python -m tox -e {0}-py39', parameters.tox) }}
displayName: 'Running tox task'
- ${{ if and(not(startsWith(parameters.tox, 'py')), startsWith(parameters.python, '3.8')) }}:
- script: |
export CONFIG_SUPPORT_TOKEN_ENV=$(VAR_CONFIG_SUPPORT_TOKEN_ENV)
${{ format('python -m tox -e {0}-py38', parameters.tox) }}
displayName: 'Running tox task'
#
# Build artifacts if this is a test target (i.e. labeled as py##)
#
- ${{ if startsWith(parameters.tox, 'py') }}:
- script: pip install --upgrade pip twine setuptools wheel
displayName: "Acquire build tools"
- script: python setup.py sdist --dist-dir "$(System.DefaultWorkingDirectory)/dist"
displayName: "Build source dist"
- script: python setup.py bdist_wheel --dist-dir "$(System.DefaultWorkingDirectory)/dist"
displayName: "Build wheel"
#
- script: python setup.py sdist --dist-dir "$(System.DefaultWorkingDirectory)/udist"
displayName: "Build source dist"
#
# Check the install artifacts
- script: ls -lR "$(System.DefaultWorkingDirectory)/dist" "$(System.DefaultWorkingDirectory)/udist"
displayName: "Listing of installed software"
#
- publish: $(System.DefaultWorkingDirectory)/dist
artifact: ${{ format('sw_{0}_{1}', parameters.tox, parameters.os) }}
#
- publish: $(System.DefaultWorkingDirectory)/udist
artifact: ${{ format('sw_u_{0}_{1}', parameters.tox, parameters.os) }}
#