Split AZP macos swift 5.3 job into a separate matrix so we can use a new name for wachos simulator and xcframeworks

This commit is contained in:
Timofey Solomko
2021-03-30 00:01:48 +03:00
parent bf4b00890a
commit aaaed7639c
2 changed files with 34 additions and 9 deletions
+23 -4
View File
@@ -10,7 +10,7 @@ stages:
- stage: test
displayName: 'Build & Test'
jobs:
- job: macos
- job: macosLegacy
strategy:
matrix:
macosSwift50:
@@ -22,9 +22,6 @@ stages:
macosSwift52:
imageName: 'macOS-10.15'
DEVELOPER_DIR: '/Applications/Xcode_11.4.1.app'
macosSwift53:
imageName: 'macOS-10.15'
DEVELOPER_DIR: '/Applications/Xcode_12.4.app'
pool:
vmImage: $(imageName)
steps:
@@ -36,6 +33,28 @@ stages:
displayName: 'Prepare Workspace'
- script: ./utils.py ci script-macos
displayName: 'Build & Test'
- script: swift build -c release
displayName: 'Build SPM Release'
- job: macosNew
# We split Xcode 12+ jobs into a separate matrix since we need to use XCFramework for this versions.
# We also need to use a different watchos simulator name for newer Xcode versions.
# For it is only for Swift 5.3 but future versions will also probably be included here.
strategy:
matrix:
macosSwift53:
imageName: 'macOS-10.15'
DEVELOPER_DIR: '/Applications/Xcode_12.4.app'
pool:
vmImage: $(imageName)
steps:
- script: |
brew update
./utils.py ci install-macos
displayName: 'Install'
- script: ./utils.py prepare-workspace macos --xcf
displayName: 'Prepare Workspace'
- script: ./utils.py ci script-macos --new-watchos-simulator
displayName: 'Build & Test'
- script: swift build -c release # Check Release build just in case.
displayName: 'Build SPM Release'
- job: linux
+11 -5
View File
@@ -27,15 +27,18 @@ def _ci_install_macos():
def _ci_install_linux():
_sprun(["eval \"$(curl -sL https://swiftenv.fuller.li/install.sh)\""], shell=True)
def _ci_script_macos():
def _ci_script_macos(new_watchos_simulator):
_sprun(["swift", "--version"])
xcodebuild_command_parts = ["xcodebuild", "-quiet", "-project", "SWCompression.xcodeproj", "-scheme", "SWCompression"]
destinations_actions = [(["-destination 'platform=OS X'"], ["clean", "test"]),
(["-destination 'platform=iOS Simulator,name=iPhone 8'"], ["clean", "test"]),
# For Swift 5.3 watchOS simulator is called differently.
(["-destination 'platform=watchOS Simulator,name=Apple Watch - 38mm'"], ["clean", "build"]),
(["-destination 'platform=tvOS Simulator,name=Apple TV'"], ["clean", "test"])]
if new_watchos_simulator:
destinations_actions.append((["-destination 'platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm'"], ["clean", "build"]))
else:
destinations_actions.append((["-destination 'platform=watchOS Simulator,name=Apple Watch - 38mm'"], ["clean", "build"]))
for destination, action in destinations_actions:
xcodebuild_command = xcodebuild_command_parts + destination + action
_sprun(xcodebuild_command)
@@ -56,7 +59,7 @@ def action_ci(args):
elif args.cmd == "install-linux":
_ci_install_linux()
elif args.cmd == "script-macos":
_ci_script_macos()
_ci_script_macos(args.new_watchos_simulator)
elif args.cmd == "script-linux":
_ci_script_linux()
else:
@@ -104,6 +107,9 @@ parser_ci = subparsers.add_parser("ci", help="a subset of commands used by CI",
description="a subset of commands used by CI")
parser_ci.add_argument("cmd", choices=["before-deploy", "install-macos", "install-linux", "script-macos", "script-linux"],
help="a command to perform on CI", metavar="CI_CMD")
parser_ci.add_argument("--new-watchos-simulator", action="store_true", dest="new_watchos_simulator",
help="use the newest watchos simulator which is necessary for xcode 12+ \
(used only by 'script-macos' subcommand)")
parser_ci.set_defaults(func=action_ci)
# Parser for 'cleanup-workspace' command.