Skip to content

Modernize Project #637

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 7 commits into from
Sep 21, 2022
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
45 changes: 27 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ jobs:
strategy:
matrix:
xcode:
- "11.7" # Swift 5.2
- "12.4" # Swift 5.3
- "12.5.1" # Swift 5.4
- "13.0" # Swift 5.5
- "13.2.1" # Swift 5.5.2
- "13.4.1" # Swift 5.6.1
- "14.0" # Swift 5.7

name: macOS 11, Xcode ${{ matrix.xcode }}
runs-on: macos-11
name: macOS 12 (Xcode ${{ matrix.xcode }})
runs-on: macos-12
steps:
- uses: actions/checkout@v1
- name: Select Xcode ${{ matrix.xcode }}
Expand All @@ -30,32 +29,42 @@ jobs:
ubuntu:
strategy:
matrix:
os: ["18.04", "20.04"]
swift:
- "5.5"
- "5.6"
- "5.7"

name: Ubuntu ${{ matrix.os }}
runs-on: ubuntu-${{ matrix.os }}
name: Ubuntu (Swift ${{ matrix.swift }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run tests
run: make test-linux
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v2
- run: swift test

windows:
strategy:
matrix:
swift:
- "5.4"
- "5.5"
- "5.6"
#- "5.7"

name: Windows 2019, Swift ${{ matrix.swift }}
name: Windows (Swift ${{ matrix.swift }})
runs-on: windows-2019

steps:
- uses: compnerd/gha-setup-swift@main
with:
branch: swift-${{ matrix.swift }}-release
tag: ${{ matrix.swift }}-RELEASE

- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v2
- uses: MaxDesiatov/swift-windows-action@v1
with:
shell-action: swift test
swift-version: ${{ matrix.swift }}
- run: swift build
- run: swift test
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
xcodeproj:
PF_DEVELOP=1 swift run xcodegen

test-linux:
docker run \
--rm \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.2 \
bash -c 'make test-swift'
swift:5.7-focal \
bash -c 'swift test'

test-macos:
set -o pipefail && \
xcodebuild test \
-scheme SnapshotTesting_macOS \
-scheme SnapshotTesting \
-destination platform="macOS" \

test-ios:
set -o pipefail && \
xcodebuild test \
-scheme SnapshotTesting_iOS \
-scheme SnapshotTesting \
-destination platform="iOS Simulator,name=iPhone 11 Pro Max,OS=13.3" \

test-swift:
Expand All @@ -27,7 +24,7 @@ test-swift:
test-tvos:
set -o pipefail && \
xcodebuild test \
-scheme SnapshotTesting_tvOS \
-scheme SnapshotTesting \
-destination platform="tvOS Simulator,name=Apple TV 4K,OS=13.3" \

test-all: test-linux test-macos test-ios
33 changes: 3 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ If your data can be represented as an image, text, or data, you can write a snap

## Installation

### Xcode 11
### Xcode

> ⚠️ Warning: By default, Xcode will try to add the SnapshotTesting package to your project's main application/framework target. Please ensure that SnapshotTesting is added to a _test_ target instead, as documented in the last step, below.

1. From the **File** menu, navigate through **Swift Packages** and select **Add Package Dependency…**.
2. Enter package repository URL: `https://github.com/pointfreeco/swift-snapshot-testing.git`
2. Enter package repository URL: `https://github.com/pointfreeco/swift-snapshot-testing`
3. Confirm the version and let Xcode resolve the package
4. On the final dialog, update SnapshotTesting's **Add to Target** column to a test target that will contain snapshot tests (if you have more than one test target, you can later add SnapshotTesting to them by manually linking the library in its build phase)

Expand All @@ -144,7 +144,7 @@ If you want to use SnapshotTesting in any other project that uses [SwiftPM](http
```swift
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
url: "https://github.com/pointfreeco/swift-snapshot-testing",
from: "1.9.0"
),
]
Expand All @@ -165,33 +165,6 @@ targets: [
]
```

### Carthage

If you use [Carthage](https://github.com/Carthage/Carthage), you can add the following dependency to your `Cartfile`:

``` ruby
github "pointfreeco/swift-snapshot-testing" ~> 1.9.0
```

> ⚠️ Warning: Carthage instructs you to drag frameworks into your Xcode project. Xcode may automatically attempt to link these frameworks to your app target. `SnapshotTesting.framework` is only compatible with test targets, so when you first add it to your project:
>
> 1. Remove `SnapshotTesting.framework` from any non-test target it may have been added to.
> 2. Add `SnapshotTesting.framework` to any applicable test targets.
> 3. Add a **New Copy Build Phase** to any applicable test targets with **Destination** set to "Frameworks", and add `SnapshotTesting.framework` as an item to this phase.
> 4. Do _not_ add `SnapshotTesting.framework` to the "Input Files" or "Output Files" of your app target's Carthage `copy-frameworks` **Run Script Phase**.
>
> See Carthage's "[Adding frameworks to unit tests or a framework](https://github.com/Carthage/Carthage#adding-frameworks-to-unit-tests-or-a-framework)" documentation for more.

### CocoaPods

If your project uses [CocoaPods](https://cocoapods.org), add the pod to any applicable test targets in your `Podfile`:

```ruby
target 'MyAppTests' do
pod 'SnapshotTesting', '~> 1.9.0'
end
```

## Features

- [**Dozens of snapshot strategies**](Documentation/Available-Snapshot-Strategies.md). Snapshot testing isn't just for `UIView`s and `CALayer`s. Write snapshots against _any_ value.
Expand Down
37 changes: 0 additions & 37 deletions SnapshotTesting.podspec

This file was deleted.

25 changes: 0 additions & 25 deletions SnapshotTesting.xcodeproj/Diff_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions SnapshotTesting.xcodeproj/SnapshotTestingTests_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions SnapshotTesting.xcodeproj/SnapshotTesting_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions SnapshotTesting.xcodeproj/WKSnapshotConfigurationShim_Info.plist

This file was deleted.

Loading