Skip to content

Commit

Permalink
Add StagehandTesting to SPM package, update CI
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Federman <[email protected]>
  • Loading branch information
luispadron and dfed committed Sep 25, 2024
1 parent 77046d2 commit 9a4e41b
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 34 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ on:

jobs:
pod-lint:
name: Pod Lint
name: CocoaPods Lint
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Bundle Install
run: bundle install --gemfile=Example/Gemfile
- name: Pod Install
run: bundle exec --gemfile=Example/Gemfile pod install --project-directory=Example
- name: Lint Stagehand Podspec
run: bundle exec --gemfile=Example/Gemfile pod lib lint --verbose --fail-fast Stagehand.podspec
- name: Lint StagehandTesting Podspec
- name: Lint podspecs
run: bundle exec --gemfile=Example/Gemfile pod lib lint --verbose --fail-fast --include-podspecs=Stagehand.podspec StagehandTesting.podspec
spm:
name: SPM Build
Expand All @@ -28,11 +24,13 @@ jobs:
fail-fast: false
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Prepare Simulator Runtimes
run: Scripts/github/prepare-simulators.sh ${{ matrix.platform }}
uses: actions/checkout@v4
- name: Build
run: |
swift build \
--sdk "$(xcode-select -p)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" \
--triple "arm64-apple-ios13.0"
# select minimum supported Xcode version
sudo xcode-select -s /Applications/Xcode_14.3.1.app
# TODO: add SPM test target, for now just run build on all products.
xcodebuild build \
-scheme Stagehand-Package \
-sdk iphonesimulator16.4 \
-destination "OS=16.4,name=iPhone 13 Pro"
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ generated/
.build/
.swiftpm/

# Bazel
bazel-*
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: b4841bd82e57283ff97d83f4bb89137cc01f6102

COCOAPODS: 1.11.3
COCOAPODS: 1.14.3
14 changes: 14 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state" : {
"revision" : "5c3d2141fb0e55da411577012c917962b6b3517e",
"version" : "1.8.0"
}
}
],
"version" : 2
}
24 changes: 21 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0.1
// swift-tools-version:5.8

//
// Copyright 2020 Square Inc.
Expand All @@ -22,18 +22,36 @@ let package = Package(
name: "Stagehand",
platforms: [
.iOS(.v12),
.macOS(.v11),
],
products: [
.library(
name: "Stagehand",
targets: ["Stagehand"]
),
.library(
name: "StagehandTesting",
targets: ["StagehandTesting"]
),
],
dependencies: [
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
.upToNextMajor(from: "1.8.0")
),
],
targets: [
.target(
name: "Stagehand",
dependencies: [],
path: "Sources/Stagehand"
dependencies: []
),
.target(
name: "StagehandTesting",
dependencies: [
"Stagehand",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
exclude: ["iOSSnapshotTestCase"]
),
],
swiftLanguageVersions: [.v5]
Expand Down
11 changes: 0 additions & 11 deletions Scripts/github/prepare-simulators.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
// limitations under the License.
//

#if BAZEL_PACKAGE
@testable import StagehandTestingCore
#if SWIFT_PACKAGE
import iOSSnapshotTestCase
#else
import FBSnapshotTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
// limitations under the License.
//

#if BAZEL_PACKAGE
@testable import StagehandTestingCore
#if SWIFT_PACKAGE
import iOSSnapshotTestCase
#else
import FBSnapshotTestCase
Expand Down
1 change: 0 additions & 1 deletion WORKSPACE.bzlmod

This file was deleted.

0 comments on commit 9a4e41b

Please sign in to comment.