Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually fail CI when tests fail #313

Merged
merged 14 commits into from
Apr 23, 2024
Prev Previous commit
Next Next commit
Remove builds with Xcode that do not support Swift Concurrency
  • Loading branch information
dfed committed Apr 23, 2024
commit b581789e6d1a5ddea47bd6567d4e5d73535113ed
63 changes: 0 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,6 @@ concurrency:
cancel-in-progress: true

jobs:
xcode-build-12:
name: Xcode 12 Build
runs-on: macOS-11
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well I broke Xcode 12 in addition to Xcode 11 builds in #308. Not ideal, but for the same reason we let #308 through, we're okay letting this change through.

Latest supported Xcode is 14. It'll be 15 on Friday.

strategy:
matrix:
platforms: [
'iOS_14',
'tvOS_14',
'watchOS_7',
'iOS_13',
'tvOS_13',
'watchOS_6',
]
fail-fast: false
timeout-minutes: 30
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Bundle Install
run: bundle install
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
- name: Prepare Simulator Runtimes
run: Scripts/github/prepare-simulators.sh ${{ matrix.platforms }}
- name: Build and Test Framework
run: Scripts/build.swift ${{ matrix.platforms }} xcode
- name: Upload Coverage Reports
if: success()
run: Scripts/upload-coverage-reports.sh ${{ matrix.platforms }}
xcode-build-13:
name: Xcode 13 Build
runs-on: macOS-12
Expand Down Expand Up @@ -119,40 +90,6 @@ jobs:
run: brew outdated carthage || brew upgrade carthage
- name: Build Framework
run: carthage build --verbose --no-skip-current --use-xcframeworks
spm-11:
name: SPM Build macOS 11
runs-on: macOS-11
timeout-minutes: 30
strategy:
matrix:
platforms: [
'iOS_14',
'tvOS_14',
'watchOS_7',
'iOS_13',
'tvOS_13',
'watchOS_6',
'macOS_11',
]
fail-fast: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Bundle Install
run: bundle install
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
if: ${{ matrix.platforms == 'iOS_14,tvOS_14,watchOS_7' }}
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
if: ${{ matrix.platforms == 'iOS_13,tvOS_13,watchOS_6' }}
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
if: ${{ matrix.platforms == 'macOS_11' }}
- name: Prepare Simulator Runtimes
run: Scripts/github/prepare-simulators.sh ${{ matrix.platforms }}
- name: Build Framework
run: Scripts/build.swift ${{ matrix.platforms }} spm
spm-12:
name: SPM Build macOS 12
runs-on: macOS-12
Expand Down
83 changes: 10 additions & 73 deletions Scripts/build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,40 @@ enum TaskError: Error {
}

enum Platform: String, CustomStringConvertible {
case iOS_13
case iOS_14
case iOS_15
case iOS_16
case iOS_17
case tvOS_13
case tvOS_14
case tvOS_15
case tvOS_16
case tvOS_17
case macOS_11
case macOS_12
case macOS_13
case macOS_14
case watchOS_6
case watchOS_7
case watchOS_8
case watchOS_9
case watchOS_10

var destination: String {
switch self {
case .iOS_13:
return "platform=iOS Simulator,OS=13.7,name=iPad Pro (12.9-inch) (4th generation)"
case .iOS_14:
return "platform=iOS Simulator,OS=14.4,name=iPad Pro (12.9-inch) (4th generation)"
case .iOS_15:
return "platform=iOS Simulator,OS=15.5,name=iPad Pro (12.9-inch) (5th generation)"
case .iOS_16:
return "platform=iOS Simulator,OS=16.4,name=iPad Pro (12.9-inch) (6th generation)"
case .iOS_17:
return "platform=iOS Simulator,OS=17.4,name=iPad Pro (12.9-inch) (6th generation)"

case .tvOS_13:
return "platform=tvOS Simulator,OS=13.4,name=Apple TV"
case .tvOS_14:
return "platform=tvOS Simulator,OS=14.3,name=Apple TV"
case .tvOS_15:
return "platform=tvOS Simulator,OS=15.4,name=Apple TV"
case .tvOS_16:
return "platform=tvOS Simulator,OS=16.4,name=Apple TV"
case .tvOS_17:
return "platform=tvOS Simulator,OS=17.4,name=Apple TV"

case .macOS_11,
.macOS_12,
case .macOS_12,
.macOS_13,
.macOS_14:
return "platform=OS X"

case .watchOS_6:
return "OS=6.2.1,name=Apple Watch Series 4 - 44mm"
case .watchOS_7:
return "OS=7.2,name=Apple Watch Series 6 - 44mm"
case .watchOS_8:
return "OS=8.5,name=Apple Watch Series 6 - 44mm"
case .watchOS_9:
Expand All @@ -86,66 +66,30 @@ enum Platform: String, CustomStringConvertible {

var sdk: String {
switch self {
case .iOS_13,
.iOS_14,
.iOS_15,
case .iOS_15,
.iOS_16,
.iOS_17:
return "iphonesimulator"

case .tvOS_13,
.tvOS_14,
.tvOS_15,
case .tvOS_15,
.tvOS_16,
.tvOS_17:
return "appletvsimulator"

case .macOS_11:
return "macosx11.1"
case .macOS_12:
return "macosx12.3"
case .macOS_13:
return "macosx13.3"
case .macOS_14:
return "macosx14.0"

case .watchOS_6,
.watchOS_7,
.watchOS_8,
case .watchOS_8,
.watchOS_9,
.watchOS_10:
return "watchsimulator"
}
}

var shouldTest: Bool {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well this is nice at least! always true!

switch self {
case .iOS_13,
.iOS_14,
.iOS_15,
.iOS_16,
.iOS_17,
.tvOS_13,
.tvOS_14,
.tvOS_15,
.tvOS_16,
.tvOS_17,
.macOS_11,
.macOS_12,
.macOS_13,
.macOS_14,
.watchOS_8,
.watchOS_9,
.watchOS_10:
return true

case .watchOS_6,
.watchOS_7:
// watchOS did not support unit testing prior to Xcode 12.5.
return false
}
}

/// Whether the platform's Xcode version requires modern SPM integration in xcodebuild, given the removal of generate-xcodeproj.
var requiresModernSPMIntegration: Bool {
switch self {
Expand All @@ -163,29 +107,22 @@ enum Platform: String, CustomStringConvertible {

var scheme: String {
switch self {
case .iOS_13,
.iOS_14,
.iOS_15,
case .iOS_15,
.iOS_16,
.iOS_17:
return "Valet iOS"

case .tvOS_13,
.tvOS_14,
.tvOS_15,
case .tvOS_15,
.tvOS_16,
.tvOS_17:
return "Valet tvOS"

case .macOS_11,
.macOS_12,
case .macOS_12,
.macOS_13,
.macOS_14:
return "Valet Mac"

case .watchOS_6,
.watchOS_7,
.watchOS_8,
case .watchOS_8,
.watchOS_9,
.watchOS_10:
return "Valet watchOS"
Expand Down Expand Up @@ -271,7 +208,7 @@ enum Task: String, CustomStringConvertible {
// Our Package isn't set up with unit test targets, because SPM can't run unit tests in a codesigned environment.
return false
case .xcode:
return platform.shouldTest
return true
}
}
}
Expand All @@ -288,7 +225,7 @@ guard let task = Task(rawValue: rawTask) else {
throw TaskError.code(1)
}

let platforms = rawPlatforms.map { rawPlatform -> Platform in
let platforms = try rawPlatforms.map { rawPlatform -> Platform in
guard let platform = Platform(rawValue: rawPlatform) else {
print("Received unknown platform type \(rawPlatform)")
throw TaskError.code(1)
Expand Down