-
Notifications
You must be signed in to change notification settings - Fork 44
/
azure-pipelines.yml
116 lines (97 loc) · 2.75 KB
/
azure-pipelines.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
jobs:
- job: 'Python_Test'
pool:
vmImage: 'Ubuntu 20.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
maxParallel: 4
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip && pip install -r requirements.txt && pip install torch==1.6.0
displayName: 'Install dependencies'
workingDirectory: 'python/'
- task: Bash@3
displayName: "Install Azurite"
inputs:
targetType: 'inline'
script: 'sudo npm install -g azurite'
- task: Bash@3
displayName: "Run Azurite"
inputs:
targetType: 'inline'
script: 'sudo azurite --silent -l /tmp --loose &'
- script: |
pip install pytest
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest'
workingDirectory: 'python/'
- task: PublishTestResults@2
inputs:
testResultsFiles: 'python/**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
- job: 'Python_Publish'
dependsOn: 'Python_Test'
pool:
vmImage: 'Ubuntu 20.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- script: python setup.py sdist
displayName: 'Build sdist'
workingDirectory: 'python/'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifact: dist'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
pathtoPublish: './'
artifactName: 'dist'
- job: 'DotNet_Build'
pool:
vmImage: 'Ubuntu 20.04'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 3.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet restore
workingDirectory: 'dotnet/'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: 'dotnet/**/*.csproj'
arguments: '--configuration Release'
# One of these days, we should add tests:
#- task: DotNetCoreCLI@2
# inputs:
# command: test
# projects: 'dotnet/**/*Tests/*.csproj'
# arguments: '--configuration $(buildConfiguration)'
- job: 'DotNet_Publish'
dependsOn: 'DotNet_Build'
pool:
vmImage: 'Ubuntu 20.04'
steps:
- script: dotnet pack
workingDirectory: 'dotnet/'
# - task: NuGetCommand@2
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# inputs:
# command: push
# nuGetFeedType: external
# publishFeedCredentials: 'mabrocks-DPU.Utils-NuGet'
# packagesToPush: 'dotnet/**/*.nupkg'