Skip to content

Commit

Permalink
Move Swift Package to 5.7. (#3653)
Browse files Browse the repository at this point in the history
### Goals ⚽
This PR moves the Swift package to Swift 5.7 and adds a specific Swift
5.6 package file.
  • Loading branch information
jshier committed Nov 21, 2022
1 parent 7884a65 commit da1f2bb
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 75 deletions.
140 changes: 84 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:
- master
- hotfix
paths:
- '.github/workflows/**'
- 'Package.swift'
- 'Source/**'
- 'Tests/**'
- ".github/workflows/**"
- "Package.swift"
- "Source/**"
- "Tests/**"
pull_request:
paths:
- '.github/workflows/**'
- 'Package.swift'
- 'Source/**'
- 'Tests/**'
- ".github/workflows/**"
- "Package.swift"
- "Source/**"
- "Tests/**"

concurrency:
group: ${{ github.ref_name }}
Expand All @@ -31,6 +31,10 @@ jobs:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.1.app"
runsOn: macOS-12
name: "macOS 12, Xcode 14.1, Swift 5.7.1"
testPlan: "macOS"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
name: "macOS 12, Xcode 14.0.1, Swift 5.7.0"
Expand All @@ -41,7 +45,7 @@ jobs:
testPlan: "macOS-NoTS"
- xcode: "Xcode_13.3.1.app"
runsOn: macOS-12
name: "macOS 12, Xcode 13.3.1, Swift 5.6"
name: "macOS 12, Xcode 13.3.1, Swift 5.6.0"
testPlan: "macOS-NoTS"
- xcode: "Xcode_13.2.1.app"
runsOn: macOS-11
Expand All @@ -57,23 +61,23 @@ jobs:
testPlan: "macOS-NoTS"
- xcode: "Xcode_12.5.1.app"
runsOn: macOS-11
name: "macOS 11, Xcode 12.5.1, Swift 5.4"
name: "macOS 11, Xcode 12.5.1, Swift 5.4.2"
testPlan: "macOS-NoTS"
- xcode: "Xcode_12.4.app"
runsOn: macOS-10.15
name: "macOS 10.15, Xcode 12.4, Swift 5.3"
name: "macOS 10.15, Xcode 12.4, Swift 5.3.2"
testPlan: "macOS-NoTS"
- xcode: "Xcode_12.3.app"
runsOn: macOS-10.15
name: "macOS 10.15, Xcode 12.3, Swift 5.3"
name: "macOS 10.15, Xcode 12.3, Swift 5.3.2"
testPlan: "macOS-NoTS"
- xcode: "Xcode_12.2.app"
runsOn: macOS-10.15
name: "macOS 10.15, Xcode 12.2, Swift 5.3"
name: "macOS 10.15, Xcode 12.2, Swift 5.3.1"
testPlan: "macOS-NoTS"
- xcode: "Xcode_12.1.1.app"
runsOn: macOS-10.15
name: "macOS 10.15, Xcode 12.1.1, Swift 5.3"
name: "macOS 10.15, Xcode 12.1.1, Swift 5.3.0"
testPlan: "macOS-NoTS"
steps:
- uses: actions/checkout@v3
Expand All @@ -85,7 +89,7 @@ jobs:
name: Test Catalyst
runs-on: macOS-12
env:
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
Expand All @@ -97,19 +101,19 @@ jobs:
name: Test Latest (iOS, tvOS, watchOS)
runs-on: macOS-12
env:
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- destination: "OS=16.0,name=iPhone 14 Pro"
- destination: "OS=16.1,name=iPhone 14 Pro"
name: "iOS"
scheme: "Alamofire iOS"
- destination: "OS=16.0,name=Apple TV"
- destination: "OS=16.1,name=Apple TV"
name: "tvOS"
scheme: "Alamofire tvOS"
- destination: "OS=9.0,name=Apple Watch Series 8 (45mm)"
- destination: "OS=9.1,name=Apple Watch Series 8 (45mm)"
name: "watchOS"
scheme: "Alamofire watchOS"
steps:
Expand All @@ -122,7 +126,7 @@ jobs:
name: "Test Old iOS"
runs-on: firebreak
env:
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer"
timeout-minutes: 10
strategy:
fail-fast: false
Expand All @@ -147,10 +151,10 @@ jobs:
- name: ${{ matrix.name }}
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
tvOS:
name: Test tvOS
name: Test Old tvOS
runs-on: firebreak
env:
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
timeout-minutes: 10
strategy:
fail-fast: false
Expand All @@ -175,10 +179,10 @@ jobs:
- name: ${{ matrix.name }}
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
watchOS:
name: Test watchOS
name: Test Old watchOS
runs-on: firebreak
env:
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
timeout-minutes: 10
strategy:
fail-fast: false
Expand Down Expand Up @@ -206,36 +210,60 @@ jobs:
fail-fast: false
matrix:
include:
- xcode: "Xcode_14.1.app"
runsOn: macOS-12
name: "macOS 12, SPM 5.7.1 Test"
run: "swift test -c debug"
- xcode: "Xcode_14.0.1.app"
runsOn: macOS-12
name: "macOS 12, SPM 5.7.0 Test"
run: "swift test -c debug"
- xcode: "Xcode_13.4.1.app"
runsOn: macOS-12
name: "macOS 12, SPM 5.6.1 Test"
run: "swift test -c debug"
- xcode: "Xcode_13.3.1.app"
runsOn: macOS-12
name: "macOS 12, SPM 5.6 Test"
name: "macOS 12, SPM 5.6.0 Test"
run: "swift test -c debug"
- xcode: "Xcode_13.2.1.app"
runsOn: macOS-11
name: "macOS 11, SPM 5.5.2 Test"
run: "swift test -c debug"
- xcode: "Xcode_13.1.app"
runsOn: macOS-11
name: "macOS 11, SPM 5.5.1 Test"
run: "swift test -c debug"
- xcode: "Xcode_13.0.app"
runsOn: macOS-11
name: "macOS 11, SPM 5.5 Test"
name: "macOS 11, SPM 5.5.0 Test"
run: "swift test -c debug"
- xcode: "Xcode_12.5.1.app"
runsOn: macOS-11
name: "macOS 11, SPM 5.4 Build"
name: "macOS 11, SPM 5.4.2 Build"
run: "swift build -c debug"
- xcode: "Xcode_12.4.app"
runsOn: macOS-10.15
name: "macOS 10.15, SPM 5.3 Build"
name: "macOS 10.15, SPM 5.3.2 Build"
run: "swift build -c debug"
- xcode: "Xcode_12.3.app"
runsOn: macOS-10.15
name: "macOS 10.15, SPM 5.3.2 Build"
run: "swift build -c debug"
- xcode: "Xcode_12.2.app"
runsOn: macOS-10.15
name: "macOS 10.15, SPM 5.3.1 Build"
run: "swift build -c debug"
- xcode: "Xcode_12.1.app"
runsOn: macOS-10.15
name: "macOS 10.15, SPM 5.3.0 Build"
run: "swift build -c debug"
steps:
- uses: actions/checkout@v3
- name: Install Firewalk
run: brew install alamofire/alamofire/firewalk && firewalk &
- name: Test SPM
run: swift build -c debug
run: ${{ matrix.run }}
Linux:
name: Linux
runs-on: ubuntu-latest
Expand Down Expand Up @@ -265,30 +293,30 @@ jobs:
runs-on: windows-2019
timeout-minutes: 10
steps:
- name: "Clone Project"
uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: Install Swift
run: |
Install-Binary -Url "https://download.swift.org/swift-5.6-release/windows10/swift-5.6-RELEASE/swift-5.6-RELEASE-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
- name: Set Environment Variables
run: |
echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Adjust Paths
run: |
echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Supporting Files
run: |
Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
- name: SPM Windows build
shell: cmd
run: |
cd ${{ github.workspace}}
set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
%SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1
- name: "Clone Project"
uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: Install Swift
run: |
Install-Binary -Url "https://download.swift.org/swift-5.6-release/windows10/swift-5.6-RELEASE/swift-5.6-RELEASE-windows10.exe" -Name "installer.exe" -ArgumentList ("-q")
- name: Set Environment Variables
run: |
echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Adjust Paths
run: |
echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Supporting Files
run: |
Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
- name: SPM Windows build
shell: cmd
run: |
cd ${{ github.workspace}}
set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk
%SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1
18 changes: 10 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ GEM
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.6.1)
activesupport (6.1.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
Expand Down Expand Up @@ -65,7 +65,7 @@ GEM
httpclient (2.8.3)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jazzy (0.14.2)
jazzy (0.14.3)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4 (~> 1.3)
Expand All @@ -77,7 +77,8 @@ GEM
xcinvoke (~> 0.3.0)
json (2.6.2)
liferaft (0.0.6)
minitest (5.16.2)
mini_portile2 (2.8.0)
minitest (5.16.3)
molinillo (0.8.0)
mustache (1.1.1)
nanaimo (0.3.0)
Expand All @@ -91,10 +92,11 @@ GEM
ruby-macho (2.5.1)
sassc (2.4.0)
ffi (~> 1.9)
sqlite3 (1.4.4)
sqlite3 (1.5.2)
mini_portile2 (~> 2.8.0)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
Expand All @@ -107,7 +109,7 @@ GEM
rexml (~> 3.2.4)
xcpretty (0.3.0)
rouge (~> 2.0.7)
zeitwerk (2.6.0)
zeitwerk (2.6.1)

PLATFORMS
ruby
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version:5.6
// swift-tools-version:5.7
//
// Package.swift
//
// Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2022 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Package@swift-5.3.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version:5.3
//
// Package@5.3.swift
// Package@swift-5.3.swift
//
// Copyright (c) 2021 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2022 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Package@swift-5.4.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version:5.4
//
// Package@5.4.swift
// Package@swift-5.4.swift
//
// Copyright (c) 2021 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2022 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Package@swift-5.5.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version:5.5
//
// Package.swift
// Package@swift-5.5.swift
//
// Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/)
// Copyright (c) 2022 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit da1f2bb

Please sign in to comment.