Skip to content

Commit

Permalink
Upgrade to Xcode 16 and macOS 15 (#1075)
Browse files Browse the repository at this point in the history
Required:

Task/Issue URL: https://app.asana.com/0/1203301625297703/1208329354262556/f
iOS PR: duckduckgo/iOS#3377
macOS PR: duckduckgo/macos-browser#3493
What kind of version bump will this require?: Patch

Description:

This change updates CI workflows to use Xcode 16 and run on macOS 15
  • Loading branch information
samsymons authored and mgurgel committed Nov 18, 2024
1 parent 33cb7da commit cf6aa5e
Show file tree
Hide file tree
Showing 20 changed files with 99 additions and 36 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

name: Run unit tests (macOS)

runs-on: macos-14
runs-on: macos-15
timeout-minutes: 30

outputs:
Expand Down Expand Up @@ -67,12 +67,13 @@ jobs:
run: set -o pipefail && swift test | tee -a build-log.txt | xcbeautify --report junit --report-path . --junit-report-filename tests.xml

- name: Publish Unit Tests Report
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: Test Report (macOS)
report_paths: tests.xml
require_tests: true
check_retries: true

- name: Update Asana with failed unit tests
if: always() # always run even if the previous step fails
Expand Down Expand Up @@ -108,7 +109,7 @@ jobs:

name: Run unit tests (iOS)

runs-on: macos-14
runs-on: macos-15
timeout-minutes: 30

steps:
Expand Down Expand Up @@ -143,7 +144,7 @@ jobs:
run: |
while xcodebuild -resolvePackageDependencies \
-scheme BrowserServicesKit-Package \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17' \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.1' \
-derivedDataPath DerivedData \
2>&1 | grep Error; do :; done
Expand All @@ -156,16 +157,18 @@ jobs:
run: |
set -o pipefail && xcodebuild test \
-scheme BrowserServicesKit \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17' \
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.1' \
-derivedDataPath DerivedData \
-skipPackagePluginValidation \
-skipMacroValidation \
-test-iterations 3 \
-retry-tests-on-failure \
CODE_SIGNING_ALLOWED=NO \
| tee -a ios-build-log.txt \
| xcbeautify --report junit --report-path . --junit-report-filename ios-unittests.xml
- name: Publish Unit Tests Report
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: Test Report (iOS)
Expand Down
2 changes: 1 addition & 1 deletion .xcode-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.4
16.1
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/GRDB.swift.git",
"state" : {
"revision" : "4225b85c9a0c50544e413a1ea1e502c802b44b35",
"version" : "2.4.0"
"revision" : "5b2f6a81099d26ae0f9e38788f51490cd6a4b202",
"version" : "2.4.2"
}
},
{
Expand Down
10 changes: 3 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/duckduckgo/duckduckgo-autofill.git", exact: "15.1.0"),
.package(url: "https://github.com/duckduckgo/GRDB.swift.git", exact: "2.4.0"),
.package(url: "https://github.com/duckduckgo/GRDB.swift.git", exact: "2.4.2"),
.package(url: "https://github.com/duckduckgo/TrackerRadarKit", exact: "3.0.0"),
.package(url: "https://github.com/duckduckgo/sync_crypto", exact: "0.3.0"),
.package(url: "https://github.com/gumob/PunycodeSwift.git", exact: "3.0.0"),
Expand Down Expand Up @@ -411,10 +411,6 @@ let package = Package(
dependencies: [
"Common"
],
resources: [
.copy("hashPrefixes.json"),
.copy("filterSet.json")
],
swiftSettings: [
.define("DEBUG", .when(configuration: .debug))
]
Expand Down Expand Up @@ -655,8 +651,8 @@ let package = Package(
"PixelKit"
],
resources: [
.copy("hashPrefixes.json"),
.copy("filterSet.json")
.copy("Resources/hashPrefixes.json"),
.copy("Resources/filterSet.json")
]
),
.testTarget(
Expand Down
2 changes: 1 addition & 1 deletion Sources/Configuration/DefaultConfigurationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ open class DefaultConfigurationManager: NSObject {

public func start() {
Logger.config.debug("Starting configuration refresh timer")
refreshTask = Task.periodic(interval: Constants.refreshCheckIntervalSeconds) {
refreshTask = Task.periodic(interval: Constants.refreshCheckIntervalSeconds) { [weak self] in
Self.queue.async { [weak self] in
self?.lastRefreshCheckTime = Date()
self?.refreshIfNeeded()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
import BrowserServicesKit
import os
Expand Down Expand Up @@ -217,3 +220,5 @@ class AdClickAttributionRulesProviderTests: XCTestCase {
}

}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
import os.log
import WebKit
Expand Down Expand Up @@ -368,3 +371,5 @@ class ClickToLoadBlockingTests: XCTestCase {
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
import os.log
import WebKit
Expand Down Expand Up @@ -203,3 +206,5 @@ class ContentBlockerReferenceTests: XCTestCase {
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import Foundation
import TrackerRadarKit
import BrowserServicesKit
Expand Down Expand Up @@ -294,3 +297,5 @@ final class ContentBlockerRulesManagerInitialCompilationTests: XCTestCase {
}

}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
import TrackerRadarKit
import BrowserServicesKit
Expand Down Expand Up @@ -352,3 +355,5 @@ class ContentBlockerRulesManagerMultipleRulesTests: ContentBlockerRulesManagerTe
}

}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
import TrackerRadarKit
import BrowserServicesKit
Expand Down Expand Up @@ -1243,3 +1246,5 @@ extension ContentBlockerRulesManager {
}

}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import BrowserServicesKit
import Common
import TrackerRadarKit
Expand Down Expand Up @@ -569,3 +572,5 @@ class ContentBlockerRulesUserScriptsTests: XCTestCase {
self.wait(for: [websiteLoaded], timeout: 30)
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
@testable import TrackerRadarKit
import os.log
Expand Down Expand Up @@ -226,3 +229,5 @@ final class SurrogatesReferenceTests: XCTestCase {
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import BrowserServicesKit
import Common
import TrackerRadarKit
Expand Down Expand Up @@ -685,3 +688,5 @@ class SurrogatesUserScriptsTests: XCTestCase {
self.wait(for: [websiteLoaded, surrogateValidated], timeout: 15)
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
import os.log
import WebKit
Expand Down Expand Up @@ -209,3 +212,5 @@ class TrackerAllowlistReferenceTests: XCTestCase {
}
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
@testable import TrackerRadarKit
@testable import BrowserServicesKit
Expand Down Expand Up @@ -260,3 +263,5 @@ private struct Test: Codable {
let property, expectPropertyValue: String
let exceptPlatforms: [String]
}

#endif
5 changes: 5 additions & 0 deletions Tests/BrowserServicesKitTests/GPC/GPCReferenceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
// limitations under the License.
//

// Tests are disabled on iOS due to WKWebView stability issues on the iOS 17.5+ simulator.
#if os(macOS)

import XCTest
import BrowserServicesKit
import os.log
Expand Down Expand Up @@ -235,3 +238,5 @@ struct GpcJavaScriptAPITest: Codable {
let exceptPlatforms: [String]
let frameURL: String?
}

#endif
Loading

0 comments on commit cf6aa5e

Please sign in to comment.