-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-templates.yml
73 lines (63 loc) · 2.19 KB
/
azure-templates.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
jobs:
- job: ${{ format(parameters.name) }}
pool:
${{ if eq(parameters.os, 'windows') }}:
vmImage: windows-latest
${{ if eq(parameters.os, 'macos') }}:
vmImage: macOS-latest
${{ if eq(parameters.os, 'linux') }}:
vmImage: ubuntu-latest
strategy:
matrix:
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
Python312:
python.version: '3.12'
maxParallel: 4
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- bash: |
export PIP_INSTALL='pip install --upgrade'
echo "##vso[task.setvariable variable=PIP_INSTALL]$PIP_INSTALL"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
displayName: Pip on Linux/Darwin
- powershell: |
Set-Variable -Name PIP_INSTALL -Value 'python -m pip install --upgrade'
Write-Host "##vso[task.setvariable variable=PIP_INSTALL]$PIP_INSTALL"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Pip on Windows
- script: |
$(PIP_INSTALL) -e .[test]
displayName: build package
- script: |
python -m pip freeze
displayName: freeze output
- script: |
pytest --cov=./ -v --junitxml=junit/test-results.xml
displayName: run test
- bash: |
curl -Os https://uploader.codecov.io/latest/${{parameters.os}}/codecov
chmod +x codecov
./codecov -t $codecov_token
env:
codecov_token: $(CODECOV_TOKEN)
condition: ne( variables['Agent.OS'], 'Windows_NT' )
displayName: codecov upload on Linux/Darwin
- powershell: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
.\codecov.exe -t ${CODECOV_TOKEN}
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: codecov upload on Windows
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Python $(python.version)-${{ format(parameters.name) }}'