Skip to content

Commit

Permalink
Extend CI for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
lunij committed Jun 24, 2024
1 parent 1a3daa9 commit 74934b5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,25 @@ jobs:
ios:
strategy:
matrix:
xcode:
- "14.3.1"
include:
- ios: "16.4"
macos: "13"
xcode: "14.3.1"
swift: "5.8.1"
- ios: "17.5"
macos: "14"
xcode: "15.4"
swift: "5.10"

name: iOS 16.4 (Xcode ${{ matrix.xcode }})
runs-on: macos-13
name: iOS ${{ matrix.ios }}, macOS ${{ matrix.macos }}, Xcode ${{ matrix.xcode }}, Swift ${{ matrix.swift }}
runs-on: macos-${{ matrix.macos }}
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Run tests
id: run-tests
run: make test-ios
run: make test-ios IOS_VERSION="${{ matrix.ios }}"
- name: Zip XCResult
id: zip-xcresult
if: failure() && steps.run-tests.conclusion == 'failure'
Expand All @@ -58,7 +65,7 @@ jobs:
if: failure() && steps.zip-xcresult.conclusion == 'success'
uses: actions/upload-artifact@v4
with:
name: xcresult-ios.zip
name: xcresult-ios${{ matrix.ios }}.zip
path: .xcresults/xcresult-ios.zip

ubuntu:
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ test-macos:
-resultBundlePath .xcresults/macos \
-workspace . | xcbeautify

IOS_VERSION ?= 16.4

test-ios:
set -o pipefail && \
xcodebuild test \
-scheme swift-snapshot-testing-Package \
-destination platform="iOS Simulator,name=iPhone 14,OS=16.4" \
-destination platform="iOS Simulator,name=iPhone 14,OS=$(IOS_VERSION)" \
-resultBundlePath .xcresults/ios \
-workspace . | xcbeautify

Expand Down
4 changes: 2 additions & 2 deletions Tests/SnapshotTestingTests/SnapshotTestingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,8 @@ final class SnapshotTestingTests: XCTestCase {
#if os(iOS)
func testUIView() {
let view = UIButton(type: .contactAdd)
assertSnapshot(of: view, as: .image)
assertSnapshot(of: view, as: .recursiveDescription)
assertSnapshot(of: view, as: .image(perceptualPrecision: 0.93))
assertSnapshot(of: view, as: .recursiveDescription, named: "\(platform)\(osVersion.majorVersion)")
}
#endif

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<UIButton; frame = (0 0; 25.6667 25.6667); opaque = NO; gestureRecognizers = <NSArray>; layer = <CALayer>>
| <UIImageView; frame = (0 0; 25.6667 25.6667); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; image = <UIImage symbol "plus.circle"; (26 26)@3{2}>; layer = <CALayer>>

0 comments on commit 74934b5

Please sign in to comment.