-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconda-osx.yml
149 lines (137 loc) · 5.23 KB
/
conda-osx.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
# Script for building CCTBX
# macOS image descriptions
# https://github.com/actions/virtual-environments/blob/master/images/macos/macos-10.15-Readme.md
# https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/macos/macos-10.14-Readme.md
#
# Template Parameters:
# pipeline: pipeline name
#
# Parameters:
# vmImage: [10, 14] # macOs version
# xcode_version: [11, 3, 1] # xCode version
# modules: <modules artifact name>
# pipeline: <pipeline name>
# builder: <cctbx builder>
# test_module: <module for testing>
jobs:
- job: ${{ format('{0}_{1}', format('macOS_{0}', join('_', parameters.vmImage)), format('xcode_{0}', join('_', parameters.xcode_version)) ) }}
pool:
vmImage: ${{ format('macOS-{0}', join('.', parameters.vmImage)) }}
timeoutInMinutes: 90
strategy:
maxParallel: 2
matrix:
python2.7:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py27
MODULES: ${{ parameters.modules }}
python3.6:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py36
MODULES: ${{ parameters.modules }}
python3.7:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py37
MODULES: ${{ parameters.modules }}
python3.8:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py38
MODULES: ${{ parameters.modules }}
variables:
artifact_name: ${{ format('xcode_{0}', join('_', parameters.xcode_version)) }}_$(PYTHON_VERSION)
day: $(Get-Date -Format dddd)
steps:
- powershell: |
Write-Host $(day)
Write-Host "##vso[task.setVariable variable=day]$(day)"
displayName: Get day of week
- script: echo $(day)
displayName: Check day of week
- script: |
echo "Selecting Xcode version ${{ join('.', parameters.xcode_version) }}"
sudo xcode-select --switch /Applications/Xcode_${{ join('.', parameters.xcode_version) }}.app/Contents/Developer
displayName: Select Xcode version
- script: |
echo "Removing homebrew from Azure to avoid conflicts."
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh > ~/uninstall_homebrew
chmod +x ~/uninstall_homebrew
~/uninstall_homebrew -f -q
rm ~/uninstall_homebrew
displayName: Remove homebrew
# download daily cached build directory for builds
# always do builds from scratch (starting with cctbx build) on Saturday night (Pacific)
# always do builds from scratch for "Weekly" pipeline
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.cctbx_build_cache.projectID)'
pipeline: '$(resources.pipeline.cctbx_build_cache.pipelineID)'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
artifact: '$(artifact_name)'
path: $(Pipeline.Workspace)
displayName: Download cached build
condition: >
and(eq(variables['Build.DefinitionName'], '${{ parameters.pipeline }}'),
eq(variables['day'], 'Sunday'))
continueOnError: true
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: '$(resources.pipeline.build_cache.projectID)'
pipeline: '$(resources.pipeline.build_cache.pipelineID)'
allowPartiallySucceededBuilds: true
allowFailedBuilds: true
artifact: '$(artifact_name)'
path: $(Pipeline.Workspace)
displayName: Download cached build
condition: >
or(and(eq(variables['Build.DefinitionName'], '${{ parameters.pipeline }}'),
ne(variables['day'], 'Sunday')),
eq(variables['Build.DefinitionName'], 'CI'),
eq(variables['Build.DefinitionName'], 'CI branch'),
eq(variables['Build.DefinitionName'], 'Full'))
continueOnError: true
- script: |
cd $(Pipeline.Workspace)
tar -xf build.tar
displayName: Extract build tarball
condition: >
or(and(eq(variables['Build.DefinitionName'], '${{ parameters.pipeline }}'),
ne(variables['day'], 'Sunday')),
eq(variables['Build.DefinitionName'], 'CI'),
eq(variables['Build.DefinitionName'], 'CI branch'),
eq(variables['Build.DefinitionName'], 'Full'))
continueOnError: true
failOnStderr: false
# build
- template: ./unix-conda-build.yml
parameters:
builder: ${{ parameters.builder }}
test_module: ${{ parameters.test_module }}
# preserve permissions
- script: |
cd $(Pipeline.Workspace)
tar -chzf build.tar build
displayName: Build tarball
condition: >
and(eq(variables['Build.DefinitionName'], '${{ parameters.pipeline }}'),
or(eq(variables['Build.Reason'], 'Schedule'),
eq(variables['Build.Reason'], 'Manual')),
eq(variables['System.StageAttempt'], 1),
eq('${{ parameters.modules }}', 'modules'))
continueOnError: true
# cache build directory every week for regular optimization build
- publish: $(Pipeline.Workspace)/build.tar
artifact: $(artifact_name)
condition: >
and(eq(variables['Build.DefinitionName'], '${{ parameters.pipeline }}'),
or(eq(variables['Build.Reason'], 'Schedule'),
eq(variables['Build.Reason'], 'Manual')),
eq(variables['System.StageAttempt'], 1),
eq('${{ parameters.modules }}', 'modules'))
continueOnError: true