Skip to content

Commit

Permalink
Migrate to Swift 5️⃣.6️⃣ (#253)
Browse files Browse the repository at this point in the history
GH Actions' macOS 12 images have Xcode 13.4.1 available which means
that Swift 5.6 is available to use in CI.

https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md#xcode

## Changes

- Update `ci.yml`:
  + Use macOS image `macos-12` which contains Xcode 13.4.1.
  + Set `DEVELOPER_DIR` env var to point to Xcode 13.4.1.
  + Remove `IOS_SDK` env var so the latest SDK is used.
  + Update `swiftpm` job to use `xcodebuild` instead of `swift build`.
  as the latter now always compiles for the current architecture
  (macOS).
  + Replace `xcpretty` with `xcbeautify` in `xcodebuild` steps.

- Make `Alicerce (SPM)` scheme public to use in CI's `swiftpm` job.

- Update CocoaPods version in `Gemfile`.

- Move Headers build phase before Compile sources in an attempt to fix
"Cycle inside Alicerce;" error.

- Silence SwiftLint warning in `Log.MultiLogger`.

- Update Package.swift's `// swift-tools-version` to 5.6.

- Update podspec's `swift_version` to 5.6.

- Update `README.md`.
  • Loading branch information
p4checo authored Jun 16, 2022
1 parent 6e97ab1 commit e1699ce
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 59 deletions.
46 changes: 27 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:
- master

env:
# https://github.com/actions/virtual-environments/tree/main/images/macos
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md#xcode
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer

jobs:
env-details:
name: Environment details
runs-on: macOS-11
runs-on: macos-12
steps:
- name: xcode version
run: xcodebuild -version -sdk
Expand All @@ -29,53 +29,61 @@ jobs:
build-test:
name: Build and Test
runs-on: macos-11
runs-on: macos-12
env:
WORKSPACE: Alicerce.xcworkspace
SCHEME: Alicerce

IOS_SDK: iphonesimulator15.2
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 13 Pro,OS=latest"

DERIVED_DATA_PATH: build
steps:
- name: git checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: install xcbeautify
run: brew install xcbeautify

- name: unit tests
run: |
set -o pipefail
xcodebuild clean build test \
-workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-sdk "$IOS_SDK" \
-destination "$IOS_DESTINATION" \
-derivedDataPath "$DERIVED_DATA_PATH" \
-enableCodeCoverage YES | xcpretty -c
-enableCodeCoverage YES \
| xcbeautify
- name: codecov upload
run: bash <(curl -s https://codecov.io/bash) -D $DERIVED_DATA_PATH -J "^$SCHEME$"

swiftpm:
name: SwiftPM Build
runs-on: macOS-11
runs-on: macos-12
env:
PLATFORM_TARGET: x86_64-apple-ios15.2-simulator
WORKSPACE: Alicerce.xcworkspace
SCHEME: "Alicerce (SPM)"
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 13 Pro,OS=latest"
steps:
- name: git checkout
uses: actions/checkout@v2

- name: xcode version
run: xcodebuild -version -sdk
- name: install xcbeautify
run: brew install xcbeautify

- name: swift build
run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "${PLATFORM_TARGET}"
- name: build
run: |
set -o pipefail
xcodebuild clean build \
-workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-destination "$IOS_DESTINATION" \
| xcbeautify
cocoapods:
name: CocoaPods Verification
runs-on: macOS-11
runs-on: macos-12
steps:
- name: git checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -104,7 +112,7 @@ jobs:

carthage:
name: Carthage Verification
runs-on: macos-11
runs-on: macos-12
steps:
- name: git checkout
uses: actions/checkout@v2
Expand All @@ -114,7 +122,7 @@ jobs:

release-github:
name: GitHub Release
runs-on: macOS-11
runs-on: macos-12
needs: [build-test, swiftpm, cocoapods, carthage]
if: startsWith(github.ref, 'refs/tags/')
steps:
Expand All @@ -133,7 +141,7 @@ jobs:
release-cocoapods:
name: CocoaPods Release
runs-on: macOS-11
runs-on: macos-12
needs: [build-test, swiftpm, cocoapods, carthage]
if: startsWith(github.ref, 'refs/tags/')
steps:
Expand Down
67 changes: 67 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/Alicerce (SPM).xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Alicerce"
BuildableName = "Alicerce"
BlueprintName = "Alicerce"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Alicerce"
BuildableName = "Alicerce"
BlueprintName = "Alicerce"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion Alicerce.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/Mindera/Alicerce.git', :tag => "#{s.version}" }

s.module_name = 'Alicerce'
s.swift_version = '5.5'
s.swift_version = '5.6'

s.ios.deployment_target = '10.0'

Expand Down
2 changes: 1 addition & 1 deletion Alicerce.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1603,9 +1603,9 @@
isa = PBXNativeTarget;
buildConfigurationList = 0A3C2D821EA7E3E900EFB7D4 /* Build configuration list for PBXNativeTarget "Alicerce" */;
buildPhases = (
0A3C2D6E1EA7E3E800EFB7D4 /* Headers */,
0A3C2D6C1EA7E3E800EFB7D4 /* Sources */,
0A3C2D6D1EA7E3E800EFB7D4 /* Frameworks */,
0A3C2D6E1EA7E3E800EFB7D4 /* Headers */,
0A3C2D6F1EA7E3E800EFB7D4 /* Resources */,
);
buildRules = (
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'cocoapods', '~> 1.10'
gem 'cocoapods', '~> 1.11'
70 changes: 37 additions & 33 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.3)
activesupport (5.2.6)
CFPropertyList (3.0.5)
rexml
activesupport (6.1.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.3)
cocoapods (1.10.1)
addressable (~> 2.6)
claide (1.1.0)
cocoapods (1.11.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.10.1)
cocoapods-core (= 1.11.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -28,66 +30,68 @@ GEM
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.19.0, < 2.0)
cocoapods-core (1.10.1)
activesupport (> 5.0, < 6)
addressable (~> 2.6)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-trunk (1.5.0)
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.10)
escape (0.0.4)
ethon (0.14.0)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.8.10)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
json (2.5.1)
minitest (5.14.4)
molinillo (0.6.6)
json (2.6.2)
minitest (5.16.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.6)
ruby-macho (1.4.0)
thread_safe (0.3.6)
public_suffix (4.0.7)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
xcodeproj (1.19.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.0)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.10)
cocoapods (~> 1.11)

BUNDLED WITH
2.1.4
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.6

import PackageDescription

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/Mindera/Alicerce/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/Mindera/Alicerce.svg)](https://github.com/Mindera/Alicerce/releases)
![platforms](https://img.shields.io/badge/platforms-iOS-lightgrey.svg)
[![Swift 5.5](https://img.shields.io/badge/Swift-5.5-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Swift 5.6](https://img.shields.io/badge/Swift-5.6-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods](https://img.shields.io/cocoapods/v/Alicerce.svg)](https://cocoapods.org/)
[![SwiftPM](https://img.shields.io/badge/SwiftPM-compatible-orange.svg)](#swift-package-manager)
Expand Down Expand Up @@ -50,7 +50,13 @@ TODO

## Compatibility ✅

### `0.15.0` ... `master`
### `master`

- iOS 10.0+
- Xcode 13.4
- Swift 5.6

### `0.15.0`

- iOS 10.0+
- Xcode 13
Expand Down
2 changes: 1 addition & 1 deletion Sources/Logging/Loggers/Log+MultiLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension Log {
public enum NoMetadataKey: Hashable {}

/// A logger that forwards logging events to multiple log destinations, while not doing any logging on its own.
public final class MultiLogger<Module: LogModule, MetadataKey: Hashable>: ModuleLogger & MetadataLogger {
public final class MultiLogger<Module: LogModule, MetadataKey: Hashable>: ModuleLogger, MetadataLogger {

/// A logger's log destination error callback closure, invoked whenever any of its destinations fails an
/// operation.
Expand Down

0 comments on commit e1699ce

Please sign in to comment.