Skip to content

Commit 1c0d764

Browse files
committed
ci: extract switching xcode into a script
1 parent c5bbde3 commit 1c0d764

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/ci/azure-pipelines/steps/run.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,11 @@ steps:
6363
displayName: Install clang
6464
condition: and(succeeded(), not(variables.SKIP_JOB))
6565

66-
# Switch to XCode 9.3 on OSX since it seems to be the last version that supports
67-
# i686-apple-darwin. We'll eventually want to upgrade this and it will probably
68-
# force us to drop i686-apple-darwin, but let's keep the wheels turning for now.
69-
- bash: |
70-
set -e
71-
sudo xcode-select --switch /Applications/Xcode_9.3.app
72-
displayName: Switch to Xcode 9.3 (OSX)
73-
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
66+
- bash: src/ci/scripts/switch-xcode.sh
67+
env:
68+
AGENT_OS: $(Agent.OS)
69+
displayName: Switch to Xcode 9.3
70+
condition: and(succeeded(), not(variables.SKIP_JOB))
7471

7572
- template: install-windows-build-deps.yml
7673

src/ci/scripts/switch-xcode.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Switch to XCode 9.3 on OSX since it seems to be the last version that supports
3+
# i686-apple-darwin. We'll eventually want to upgrade this and it will probably
4+
# force us to drop i686-apple-darwin, but let's keep the wheels turning for now.
5+
6+
set -euo pipefail
7+
IFS=$'\n\t'
8+
9+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
10+
11+
if isMacOS; then
12+
sudo xcode-select --switch /Applications/Xcode_9.3.app
13+
fi

0 commit comments

Comments
 (0)