Skip to content

Commit

Permalink
Add StagehandTesting to SPM package, update CI (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Federman <[email protected]>
  • Loading branch information
luispadron and dfed authored Sep 26, 2024
1 parent 7fdf9a2 commit 35b4691
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 34 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ jobs:
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,14 +24,17 @@ 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"
xcode-build:
name: Xcode Build
runs-on: macOS-14
Expand All @@ -46,8 +45,6 @@ jobs:
uses: actions/checkout@v4
- name: Bundle Install
run: bundle install --gemfile=Example/Gemfile
- name: Prepare Simulator Runtimes
run: Scripts/github/prepare-simulators.sh ${{ matrix.platform }}
- name: Pod Install
run: bundle exec --gemfile=Example/Gemfile pod install --project-directory=Example
- name: Select Xcode Version
Expand Down
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-*
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 35b4691

Please sign in to comment.