-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathconda-osx.yml
161 lines (148 loc) · 5.67 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
150
151
152
153
154
155
156
157
158
159
160
161
# 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
#
# Parameters:
# vmImage: [10, 14] # macOs version
# xcode_version: [11, 3, 1] # xCode version
# modules: <modules artifact name>
# template: <build template file>
# prefix: <build artifact prefix>
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: 180
strategy:
maxParallel: 2
matrix:
python2.7:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py27
MODULES: ${{ parameters.modules }}
python3.9:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py39
MODULES: ${{ parameters.modules }}
python3.10:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py310
MODULES: ${{ parameters.modules }}
python3.11:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py311
MODULES: ${{ parameters.modules }}
python3.12:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py312
MODULES: ${{ parameters.modules }}
python3.13:
CONDA: MacOSX
OS: osx-64
PYTHON_VERSION: py313
MODULES: ${{ parameters.modules }}
variables:
- name: artifact_name
value: ${{ parameters.prefix }}${{ format('xcode_{0}', join('_', parameters.xcode_version)) }}_$(PYTHON_VERSION)
- name: day
value: $(Get-Date -Format dddd)
steps:
- script: |
job_name=`echo $(Agent.JobName) | sed s/" "/"_"/g`
echo "##vso[task.setvariable variable=job_name]$job_name"
displayName: Set job_name
- powershell: |
Write-Host $(day)
Write-Host "##vso[task.setVariable variable=day]$(day)"
displayName: Get day of week
- script: |
echo $(job_name)
echo $(day)
displayName: Check variables
- 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 for "Update build cache" on Saturday night (Pacific)
# always do builds from scratch for "Weekly" pipeline
- 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: >
and(or(and(eq(variables['Build.DefinitionName'], 'Update build cache'),
ne(variables['day'], 'Sunday')),
eq(variables['Build.DefinitionName'], 'CI'),
eq(variables['Build.DefinitionName'], 'CI branch'),
eq(variables['Build.DefinitionName'], 'XFEL CI'),
eq(variables['Build.DefinitionName'], 'XFEL CI branch'),
eq(variables['Build.DefinitionName'], 'Full')),
ne(variables['SKIP_CACHED_BUILD'], 'true'))
continueOnError: true
- script: |
cd $(Pipeline.Workspace)
tar -xf build.tar
displayName: Extract build tarball
condition: >
and(or(and(eq(variables['Build.DefinitionName'], 'Update build cache'),
ne(variables['day'], 'Sunday')),
eq(variables['Build.DefinitionName'], 'CI'),
eq(variables['Build.DefinitionName'], 'CI branch'),
eq(variables['Build.DefinitionName'], 'XFEL CI'),
eq(variables['Build.DefinitionName'], 'XFEL CI branch'),
eq(variables['Build.DefinitionName'], 'Full')),
ne(variables['SKIP_CACHED_BUILD'], 'true'))
continueOnError: true
failOnStderr: false
- script: |
set -xe
for f in cctbx_geometry_restraints_ext.so scitbx_array_family_flex_ext.so ; do
rm -f $(Pipeline.Workspace)/build/lib/${f}
done
displayName: Fix broken cache on macOS
continueOnError: true
failOnStderr: false
# build
- template: ${{ parameters.template }}
# preserve permissions
- script: |
cd $(Pipeline.Workspace)
tar -chf build.tar build
displayName: Build tarball
condition: >
and(eq(variables['Build.DefinitionName'], 'Update build cache'),
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'], 'Update build cache'),
or(eq(variables['Build.Reason'], 'Schedule'),
eq(variables['Build.Reason'], 'Manual')),
eq(variables['System.StageAttempt'], 1),
eq('${{ parameters.modules }}', 'modules'))
continueOnError: true