Skip to content

Commit

Permalink
Bump the Swift version to 6.0 (#2)
Browse files Browse the repository at this point in the history
* Bump the Swift version to 6.0

* Update workflows
  • Loading branch information
ns-vasilev authored Dec 25, 2024
1 parent b33333f commit d73fe0e
Showing 9 changed files with 284 additions and 38 deletions.
229 changes: 202 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ on:
- "Package.swift"
- "Source/**"
- "Tests/**"

jobs:
SwiftLint:
runs-on: ubuntu-latest
@@ -23,40 +24,214 @@ jobs:
args: --strict
env:
DIFF_BASE: ${{ github.base_ref }}
Latest:
name: Test Latest (iOS, macOS, tvOS, watchOS)
runs-on: macOS-12
macOS:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- xcode: "Xcode_16.0"
runsOn: macOS-14
name: "macOS 14, Xcode 16.0, Swift 6.0"
- xcode: "Xcode_15.4"
runsOn: macOS-14
name: "macOS 14, Xcode 15.4, Swift 5.10"
- xcode: "Xcode_15.0"
runsOn: macos-13
name: "macOS 13, Xcode 15.0, Swift 5.9.0"
- xcode: "Xcode_14.3.1"
runsOn: macos-13
name: "macOS 13, Xcode 14.3.1, Swift 5.8.0"
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "Lazy" -destination "platform=macOS" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
- name: Upload test coverage reports to Codecov
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
with:
scheme_name: Lazy
filename: ${{ matrix.name }}
token: ${{ secrets.CODECOV_TOKEN }}

iOS:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- destination: "OS=18.1,name=iPhone 16 Pro"
name: "iOS 18.1"
xcode: "Xcode_16.1"
runsOn: macOS-14
- destination: "OS=18.0,name=iPhone 16 Pro"
name: "iOS 18.0"
xcode: "Xcode_16.0"
runsOn: macOS-14
- destination: "OS=17.5,name=iPhone 15 Pro"
name: "iOS 17.5"
xcode: "Xcode_15.4"
runsOn: macOS-14
- destination: "OS=17.0.1,name=iPhone 14 Pro"
name: "iOS 17.0.1"
xcode: "Xcode_15.0"
runsOn: macos-13
- destination: "OS=16.4,name=iPhone 14 Pro"
name: "iOS 16.4"
xcode: "Xcode_14.3.1"
runsOn: macos-13
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "Lazy" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
- name: Upload test coverage reports to Codecov
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
with:
scheme_name: Lazy
filename: ${{ matrix.name }}
token: ${{ secrets.CODECOV_TOKEN }}

tvOS:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- destination: "OS=18.1,name=Apple TV"
name: "tvOS 18.1"
xcode: "Xcode_16.1"
runsOn: macOS-14
- destination: "OS=18.0,name=Apple TV"
name: "tvOS 18.0"
xcode: "Xcode_16.0"
runsOn: macOS-14
- destination: "OS=17.5,name=Apple TV"
name: "tvOS 17.5"
xcode: "Xcode_15.4"
runsOn: macOS-14
- destination: "OS=17.0,name=Apple TV"
name: "tvOS 17.0"
xcode: "Xcode_15.0"
runsOn: macos-13
- destination: "OS=16.4,name=Apple TV"
name: "tvOS 16.4"
xcode: "Xcode_14.3.1"
runsOn: macos-13
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "Lazy" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
- name: Upload test coverage reports to Codecov
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
with:
scheme_name: Lazy
filename: ${{ matrix.name }}
token: ${{ secrets.CODECOV_TOKEN }}

watchOS:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
timeout-minutes: 10
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- destination: "OS=16.1,name=iPhone 14 Pro"
name: "iOS"
scheme: "Lazy"
sdk: iphonesimulator
- destination: "OS=16.1,name=Apple TV"
name: "tvOS"
scheme: "Lazy"
sdk: appletvsimulator
- destination: "OS=9.1,name=Apple Watch Series 8 (45mm)"
name: "watchOS"
scheme: "Lazy"
sdk: watchsimulator
- destination: "platform=macOS"
name: "macOS"
scheme: "Lazy"
sdk: macosx
- destination: "OS=11.1,name=Apple Watch Series 10 (46mm)"
name: "watchOS 11.1"
xcode: "Xcode_16.1"
runsOn: macOS-14
- destination: "OS=11.0,name=Apple Watch Series 10 (46mm)"
name: "watchOS 11.0"
xcode: "Xcode_16.0"
runsOn: macOS-14
- destination: "OS=10.5,name=Apple Watch Series 9 (45mm)"
name: "watchOS 10.5"
xcode: "Xcode_15.4"
runsOn: macOS-14
- destination: "OS=10.0,name=Apple Watch Series 9 (45mm)"
name: "watchOS 10.0"
xcode: "Xcode_15.0"
runsOn: macos-13
- destination: "OS=9.4,name=Apple Watch Series 8 (45mm)"
name: "watchOS 9.4"
xcode: "Xcode_14.3.1"
runsOn: macos-13
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "./${{ matrix.sdk }}.xcresult" | xcpretty -r junit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3.1.0
run: xcodebuild test -scheme "Lazy" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
- name: Upload test coverage reports to Codecov
uses: space-code/oss-common-actions/.github/actions/upload_test_coverage_report@main
with:
scheme_name: Lazy
filename: ${{ matrix.name }}
token: ${{ secrets.CODECOV_TOKEN }}
xcode: true
xcode_archive_path: "./${{ matrix.sdk }}.xcresult"


spm:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runsOn }}
env:
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- name: "macOS 14, SPM 6.0.2 Test"
xcode: "Xcode_16.1"
runsOn: macOS-14
- name: "macOS 14, SPM 6.0.0 Test"
xcode: "Xcode_16.0"
runsOn: macOS-14
- name: "macOS 14, SPM 5.9.0 Test"
xcode: "Xcode_15.0"
runsOn: macos-14
- name: "macOS 13, SPM 5.8.1 Test"
xcode: "Xcode_14.3.1"
runsOn: macos-13
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
run: swift build -c release

merge-test-reports:
needs: [iOS, macOS, watchOS, tvOS]
runs-on: macos-13
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: test_output
- run: xcrun xcresulttool merge test_output/**/*.xcresult --output-path test_output/final/final.xcresult
- name: Upload Merged Artifact
uses: actions/upload-artifact@v4
with:
name: MergedResult
path: test_output/final

discover-typos:
name: Discover Typos
runs-on: macOS-13
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- name: Discover typos
run: |
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin"
python3 -m pip install --upgrade pip
python3 -m pip install codespell
codespell --ignore-words-list="hart,inout,msdos,sur" --skip="./.build/*,./.git/*"
4 changes: 2 additions & 2 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@ jobs:
- name: ruby setup
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1.4
bundler-cache: true
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup gems
run: |
gem install bundler
5 changes: 4 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@ excluded:
- Tests
- Package.swift
- Package@swift-5.7.swift
- Package@swift-5.8.swift
- Package@swift-5.9.swift
- Package@swift-5.10.swift
- .build

# Rules
@@ -132,4 +135,4 @@ nesting:
type_name:
max_length:
warning: 40
error: 50
error: 50
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Lazy",
platforms: [
.iOS(.v11),
.iOS(.v12),
.macOS(.v10_13),
.tvOS(.v11),
.tvOS(.v12),
.watchOS(.v4),
.visionOS(.v1),
],
23 changes: 23 additions & 0 deletions Package@swift-5.10.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Lazy",
platforms: [
.iOS(.v12),
.macOS(.v10_13),
.tvOS(.v12),
.watchOS(.v4),
.visionOS(.v1),
],
products: [
.library(name: "Lazy", targets: ["Lazy"]),
],
dependencies: [],
targets: [
.target(name: "Lazy", dependencies: []),
.testTarget(name: "LazyTests", dependencies: ["Lazy"]),
]
)
4 changes: 2 additions & 2 deletions Package@swift-5.7.swift
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@ import PackageDescription
let package = Package(
name: "Lazy",
platforms: [
.iOS(.v11),
.iOS(.v12),
.macOS(.v10_13),
.tvOS(.v11),
.tvOS(.v12),
.watchOS(.v4),
],
products: [
22 changes: 22 additions & 0 deletions Package@swift-5.8.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Lazy",
platforms: [
.iOS(.v12),
.macOS(.v10_13),
.tvOS(.v12),
.watchOS(.v4),
],
products: [
.library(name: "Lazy", targets: ["Lazy"]),
],
dependencies: [],
targets: [
.target(name: "Lazy", dependencies: []),
.testTarget(name: "LazyTests", dependencies: ["Lazy"]),
]
)
23 changes: 23 additions & 0 deletions Package@swift-5.9.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Lazy",
platforms: [
.iOS(.v12),
.macOS(.v10_13),
.tvOS(.v12),
.watchOS(.v4),
.visionOS(.v1),
],
products: [
.library(name: "Lazy", targets: ["Lazy"]),
],
dependencies: [],
targets: [
.target(name: "Lazy", dependencies: []),
.testTarget(name: "LazyTests", dependencies: ["Lazy"]),
]
)
Loading

0 comments on commit d73fe0e

Please sign in to comment.