Skip to content

Update CI to Swift 5.10 #56

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

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.2" # Swift 5.9.2
- os: macos-14
xcode-version: "15.2" # Swift 5.9.2
xcode-version: "15.3" # Swift 5.10
runs-on: ${{ matrix.os }}
env:
OPENGRAPH_WERROR: 1
OPENGRAPH_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 1
OPENGRAPH_COMPATIBILITY_TEST: 1
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
Expand All @@ -26,19 +29,15 @@ jobs:
xcode-version: ${{ matrix.xcode-version }}
- name: Swift version
run: swift --version
- name: Run tests against Apple's AttributeGraph on macOS
- name: Run tests against Apple's AttributeGraph on macOS via SwiftPM
run: |
swift test \
--build-path .build-compatibility-test-debug
env:
OPENGRAPH_ATTRIBUTEGRAPH: 1
OPENGRAPH_COMPATIBILITY_TEST: 1
# FIXME: macOS 13 CI issue. Can't reproduce on macOS 14 locally
# - name: Run tests against Apple's AttributeGraph on macOS
# run: |
# xcodebuild test \
# -scheme OpenGraph-Package \
# -sdk macosx \
# -destination "platform=macOS"
# env:
# OPENGRAPH_COMPATIBILITY_TEST: 1
- name: Run tests against Apple's AttributeGraph on macOS via Xcode
run: |
xcodebuild test \
-scheme OpenGraph-Package \
-sdk macosx \
-destination "platform=macOS" \
-skipPackagePluginValidation \
-skipMacroValidation
10 changes: 6 additions & 4 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:
fail-fast: false
matrix:
include:
# macOS 13 CI issue: "/Users/runner/work/_temp/3a207233-d293-4e92-9dd3-b83f7ccd4597.sh: line 7: 2698 Segmentation fault: 11 xcodebuild build"
# - os: macos-13
# xcode-version: "15.2" # Swift 5.9.2
- os: macos-14
xcode-version: "15.2" # Swift 5.9.2
xcode-version: "15.3" # Swift 5.10
runs-on: ${{ matrix.os }}
env:
OPENGRAPH_WERROR: 1
OPENGRAPH_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 0
OPENGRAPH_COMPATIBILITY_TEST: 0
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.2" # Swift 5.9.2
- os: macos-14
xcode-version: "15.2" # Swift 5.9.2
xcode-version: "15.3" # Swift 5.10
runs-on: ${{ matrix.os }}
env:
OPENGRAPH_WERROR: 1
OPENGRAPH_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 0
OPENGRAPH_COMPATIBILITY_TEST: 0
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
Expand All @@ -30,7 +33,6 @@ jobs:
run: |
swift test \
-c debug \
-Xswiftc -warnings-as-errors \
--enable-code-coverage \
--build-path .build-test-debug
xcrun llvm-cov show \
Expand All @@ -41,7 +43,6 @@ jobs:
run: |
swift test \
-c release \
-Xswiftc -warnings-as-errors \
--enable-code-coverage \
--build-path .build-test-release
- uses: codecov/codecov-action@v3
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ jobs:
strategy:
fail-fast: false
matrix:
swift_version: ["5.9.2"]
swift_version: ["5.10"]
runs-on: ubuntu-22.04
env:
OPENGRAPH_WERROR: 1
OPENGRAPH_SWIFT_TESTING: 1
OPENGRAPH_ATTRIBUTEGRAPH: 0
OPENGRAPH_COMPATIBILITY_TEST: 0
container: swift:${{ matrix.swift_version }}-jammy
steps:
- uses: actions/checkout@v4
Expand All @@ -24,7 +29,6 @@ jobs:
run: |
swift test \
-c debug \
-Xswiftc -warnings-as-errors \
--enable-code-coverage \
--build-path .build-test-debug
llvm-cov show \
Expand All @@ -35,7 +39,6 @@ jobs:
run: |
swift test \
-c release \
-Xswiftc -warnings-as-errors \
--build-path .build-test-release
- uses: codecov/codecov-action@v3
with:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ jobs:
strategy:
fail-fast: false
matrix:
swift_version: ["5.9.1"]
swift_version: ["5.10-SNAPSHOT-2024-03-30-a"] # "5.10-RELEASE" is not release for WASM, tracked via https://github.com/swiftwasm/swift/issues/5570
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
env:
OPENGRAPH_WERROR: 1
OPENGRAPH_SWIFT_TESTING: 0
OPENGRAPH_ATTRIBUTEGRAPH: 0
OPENGRAPH_COMPATIBILITY_TEST: 0
steps:
- uses: actions/checkout@v4
- uses: swiftwasm/setup-swiftwasm@v1
with:
swift-version: wasm-${{ matrix.swift_version }}-RELEASE
swift-version: wasm-${{ matrix.swift_version }}
- name: build
run: |
swift build --triple wasm32-unknown-wasi
Expand Down
11 changes: 6 additions & 5 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import Foundation
Expand All @@ -18,10 +18,11 @@ func envEnable(_ key: String, default defaultValue: Bool = false) -> Bool {
}

let isXcodeEnv = Context.environment["__CFBundleIdentifier"] == "com.apple.dt.Xcode"
let development = envEnable("OPENGRAPH_DEVELOPMENT", default: false)

var sharedSwiftSettings: [SwiftSetting] = []

let warningsAsErrorsCondition = envEnable("OPENGRAPH_WERROR", default: isXcodeEnv)
let warningsAsErrorsCondition = envEnable("OPENGRAPH_WERROR", default: isXcodeEnv && development)
if warningsAsErrorsCondition {
sharedSwiftSettings.append(.unsafeFlags(["-warnings-as-errors"]))
}
Expand Down Expand Up @@ -125,8 +126,7 @@ if attributeGraphCondition {
let swiftTestingCondition = envEnable("OPENGRAPH_SWIFT_TESTING", default: true)
if swiftTestingCondition {
package.dependencies.append(
// Fix it to be 0.3.0 before we bump to Swift 5.10
.package(url: "https://github.com/apple/swift-testing", exact: "0.3.0")
.package(url: "https://github.com/apple/swift-testing", exact: "0.6.0")
)
openGraphTestTarget.dependencies.append(
.product(name: "Testing", package: "swift-testing")
Expand Down