forked from modelica/Reference-FMUs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
165 lines (129 loc) · 3.81 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
variables:
fmpy: https://github.com/CATIA-Systems/FMPy/archive/714219e0d8b12b0f1afab1d2c1d2190ab7cb194a.zip
conda.packages: python=3.7 dask lark-parser lxml numpy pathlib pip pytest requests scipy
jobs:
- job: lint_files
displayName: 'Lint Files'
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: |
python3 lint_files.py
displayName: Lint files
- job: linux64
displayName: 'Ubuntu 16.04'
pool:
vmImage: 'ubuntu-16.04'
dependsOn:
- lint_files
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda create --yes --quiet --name ref_fmus --channel conda-forge $CONDA_PACKAGES
displayName: Create Conda environment
- bash: |
source activate ref_fmus
python -m pip install --no-deps $FMPY
displayName: Install FMPy
- bash: |
source activate ref_fmus
pytest --junitxml=junit/test-results.xml
displayName: Build and run tests
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results'
- task: PublishPipelineArtifact@1
inputs:
path: fmus
artifact: linux64
- job: darwin64
displayName: 'macOS 10.15'
pool:
vmImage: 'macos-10.15'
dependsOn:
- lint_files
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
# On Hosted macOS, the agent user doesn't have ownership of Miniconda's installation directory/
# We need to take ownership if we want to update conda or install packages globally
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
- bash: conda create --yes --quiet --name ref_fmus --channel conda-forge $CONDA_PACKAGES
displayName: Create Anaconda environment
- bash: |
source activate ref_fmus
python -m pip install --no-deps $FMPY
displayName: Install FMPY
- bash: |
source activate ref_fmus
pytest --junitxml=junit/test-results.xml
displayName: Build and run tests
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results'
- task: PublishPipelineArtifact@1
inputs:
path: fmus
artifact: darwin64
- job: win64
displayName: 'Windows 2016'
pool:
vmImage: 'vs2017-win2016'
dependsOn:
- lint_files
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: conda create --yes --quiet --name ref_fmus --channel conda-forge %CONDA_PACKAGES% pywin32
displayName: Create Anaconda environment
- script: |
call activate ref_fmus
python -m pip install --no-deps %FMPY%
displayName: Install FMPy
- script: |
call activate ref_fmus
pytest --junitxml=junit/test-results.xml
displayName: Build, install and run tests
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results'
- task: PublishPipelineArtifact@1
inputs:
path: fmus
artifact: win64
- job: merge
dependsOn:
- linux64
- darwin64
- win64
displayName: 'Merge platform binaries'
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: mkdir fmus
displayName: Create fmus directory
- task: DownloadPipelineArtifact@2
inputs:
artifact: linux64
downloadPath: fmus
- task: DownloadPipelineArtifact@2
inputs:
artifact: darwin64
downloadPath: fmus
- task: DownloadPipelineArtifact@2
inputs:
artifact: win64
downloadPath: fmus
- bash: python3 merge_platform_binaries.py
displayName: Merge FMUs
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: merged_fmus.zip
artifactName: merged_fmus