Skip to content

Commit 1435003

Browse files
stephencelisniilohlin
authored andcommitted
Modernize Project (pointfreeco#637)
* Modernize Project Getting the project into some modern order before next release. * Update ci.yml * Update ci.yml * wip * wip * wip * Update ci.yml
1 parent b4f0a51 commit 1435003

17 files changed

+39
-2051
lines changed

.github/workflows/ci.yml

+27-18
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
xcode:
16-
- "11.7" # Swift 5.2
17-
- "12.4" # Swift 5.3
18-
- "12.5.1" # Swift 5.4
19-
- "13.0" # Swift 5.5
16+
- "13.2.1" # Swift 5.5.2
17+
- "13.4.1" # Swift 5.6.1
18+
- "14.0" # Swift 5.7
2019

21-
name: macOS 11, Xcode ${{ matrix.xcode }}
22-
runs-on: macos-11
20+
name: macOS 12 (Xcode ${{ matrix.xcode }})
21+
runs-on: macos-12
2322
steps:
2423
- uses: actions/checkout@v1
2524
- name: Select Xcode ${{ matrix.xcode }}
@@ -30,32 +29,42 @@ jobs:
3029
ubuntu:
3130
strategy:
3231
matrix:
33-
os: ["18.04", "20.04"]
32+
swift:
33+
- "5.5"
34+
- "5.6"
35+
- "5.7"
3436

35-
name: Ubuntu ${{ matrix.os }}
36-
runs-on: ubuntu-${{ matrix.os }}
37+
name: Ubuntu (Swift ${{ matrix.swift }})
38+
runs-on: ubuntu-latest
3739
steps:
38-
- uses: actions/checkout@v1
39-
- name: Run tests
40-
run: make test-linux
40+
- uses: swift-actions/setup-swift@v1
41+
with:
42+
swift-version: ${{ matrix.swift }}
43+
- uses: actions/checkout@v2
44+
- run: swift test
4145

4246
windows:
4347
strategy:
4448
matrix:
4549
swift:
46-
- "5.4"
4750
- "5.5"
51+
- "5.6"
52+
#- "5.7"
4853

49-
name: Windows 2019, Swift ${{ matrix.swift }}
54+
name: Windows (Swift ${{ matrix.swift }})
5055
runs-on: windows-2019
5156

5257
steps:
58+
- uses: compnerd/gha-setup-swift@main
59+
with:
60+
branch: swift-${{ matrix.swift }}-release
61+
tag: ${{ matrix.swift }}-RELEASE
62+
5363
- name: Set git to use LF
5464
run: |
5565
git config --global core.autocrlf false
5666
git config --global core.eol lf
67+
5768
- uses: actions/checkout@v2
58-
- uses: MaxDesiatov/swift-windows-action@v1
59-
with:
60-
shell-action: swift test
61-
swift-version: ${{ matrix.swift }}
69+
- run: swift build
70+
- run: swift test

Makefile

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
xcodeproj:
2-
PF_DEVELOP=1 swift run xcodegen
3-
41
test-linux:
52
docker run \
63
--rm \
74
-v "$(PWD):$(PWD)" \
85
-w "$(PWD)" \
9-
swift:5.2 \
10-
bash -c 'make test-swift'
6+
swift:5.7-focal \
7+
bash -c 'swift test'
118

129
test-macos:
1310
set -o pipefail && \
1411
xcodebuild test \
15-
-scheme SnapshotTesting_macOS \
12+
-scheme SnapshotTesting \
1613
-destination platform="macOS" \
1714

1815
test-ios:
1916
set -o pipefail && \
2017
xcodebuild test \
21-
-scheme SnapshotTesting_iOS \
18+
-scheme SnapshotTesting \
2219
-destination platform="iOS Simulator,name=iPhone 11 Pro Max,OS=13.3" \
2320

2421
test-swift:
@@ -27,7 +24,7 @@ test-swift:
2724
test-tvos:
2825
set -o pipefail && \
2926
xcodebuild test \
30-
-scheme SnapshotTesting_tvOS \
27+
-scheme SnapshotTesting \
3128
-destination platform="tvOS Simulator,name=Apple TV 4K,OS=13.3" \
3229

3330
test-all: test-linux test-macos test-ios

README.md

+3-30
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ If your data can be represented as an image, text, or data, you can write a snap
128128

129129
## Installation
130130

131-
### Xcode 11
131+
### Xcode
132132

133133
> ⚠️ 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.
134134
135135
1. From the **File** menu, navigate through **Swift Packages** and select **Add Package Dependency…**.
136-
2. Enter package repository URL: `https://github.com/pointfreeco/swift-snapshot-testing.git`
136+
2. Enter package repository URL: `https://github.com/pointfreeco/swift-snapshot-testing`
137137
3. Confirm the version and let Xcode resolve the package
138138
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)
139139

@@ -144,7 +144,7 @@ If you want to use SnapshotTesting in any other project that uses [SwiftPM](http
144144
```swift
145145
dependencies: [
146146
.package(
147-
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
147+
url: "https://github.com/pointfreeco/swift-snapshot-testing",
148148
from: "1.9.0"
149149
),
150150
]
@@ -165,33 +165,6 @@ targets: [
165165
]
166166
```
167167

168-
### Carthage
169-
170-
If you use [Carthage](https://github.com/Carthage/Carthage), you can add the following dependency to your `Cartfile`:
171-
172-
``` ruby
173-
github "pointfreeco/swift-snapshot-testing" ~> 1.9.0
174-
```
175-
176-
> ⚠️ 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:
177-
>
178-
> 1. Remove `SnapshotTesting.framework` from any non-test target it may have been added to.
179-
> 2. Add `SnapshotTesting.framework` to any applicable test targets.
180-
> 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.
181-
> 4. Do _not_ add `SnapshotTesting.framework` to the "Input Files" or "Output Files" of your app target's Carthage `copy-frameworks` **Run Script Phase**.
182-
>
183-
> 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.
184-
185-
### CocoaPods
186-
187-
If your project uses [CocoaPods](https://cocoapods.org), add the pod to any applicable test targets in your `Podfile`:
188-
189-
```ruby
190-
target 'MyAppTests' do
191-
pod 'SnapshotTesting', '~> 1.9.0'
192-
end
193-
```
194-
195168
## Features
196169

197170
- [**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.

SnapshotTesting.podspec

-37
This file was deleted.

SnapshotTesting.xcodeproj/Diff_Info.plist

-25
This file was deleted.

SnapshotTesting.xcodeproj/SnapshotTestingTests_Info.plist

-25
This file was deleted.

SnapshotTesting.xcodeproj/SnapshotTesting_Info.plist

-25
This file was deleted.

SnapshotTesting.xcodeproj/WKSnapshotConfigurationShim_Info.plist

-25
This file was deleted.

0 commit comments

Comments
 (0)