From 9170a970d95f6df046abbe73371123c2c58e20b5 Mon Sep 17 00:00:00 2001 From: Rhishi Katoch Date: Tue, 29 Aug 2023 18:10:15 -0400 Subject: [PATCH] SPM support --- .github/workflows/build.yml | 1 + Example/fastlane/Fastfile | 13 +++++++------ Package.swift | 29 +++++++++++++++++++++++++++++ Swerkin.podspec | 2 +- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 Package.swift diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 546ecad..530adfe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,7 @@ jobs: run: bundle exec fastlane ui_test - name: Uploading Artifacts + if: ${{ always() }} uses: actions/upload-artifact@v3 with: name: tests Artifacts diff --git a/Example/fastlane/Fastfile b/Example/fastlane/Fastfile index fb42942..9f5f254 100644 --- a/Example/fastlane/Fastfile +++ b/Example/fastlane/Fastfile @@ -56,7 +56,7 @@ if (installed_xcodes.empty? || !installed_xcodes.include?(requested_xcode)) end end -simulator = "iPhone 14 Pro" +simulator = "iPhone 14 Pro (16.4)" # Select Xcode Defined in ENV or Fastfile xcode_select requested_xcode @@ -66,21 +66,22 @@ default_platform(:ios) platform :ios do lane :ui_test do scan( + workspace: "Swerkin.xcworkspace", scheme: "Swerkin-UITests", only_testing: "Swerkin-UITests", test_without_building: true, + devices: [simulator], configuration: "Debug", sdk: "iphonesimulator", - workspace: "Swerkin.xcworkspace", - devices: [simulator], output_types: "junit,html", output_files: "swerkin_app.junit", + result_bundle: true, buildlog_path: "./fastlane/test_output" - ) + ) end lane :unit_test do - scan( + scan( workspace: "Swerkin.xcworkspace", scheme: "Swerkin-UnitTests", only_testing: "Swerkin-UnitTests", @@ -90,7 +91,7 @@ platform :ios do output_files: "swerkin_app.junit", result_bundle: true, buildlog_path: "./fastlane/test_output" - ) + ) end lane :build_for_testing do diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..20c0707 --- /dev/null +++ b/Package.swift @@ -0,0 +1,29 @@ +// swift-tools-version:5.3 + +import PackageDescription + +let package = Package( + name: "Swerkin", + platforms: [.iOS(.v12)], + products: [ + // Products define the executables and libraries a package produces, making them visible to other packages. + .library( + name: "Swerkin", + targets: ["Swerkin-UITests"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + .package(url: "https://github.com/kif-framework/KIF.git", .upToNextMajor(from: "3.8.9")), + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .target( + name: "Swerkin-UITests", + dependencies: ["KIF"], + path: "Sources", + sources: ["Swerkin/Classes", "Sources/SwerkinAdditions"]), + ], + swiftLanguageVersions: [.v5] +) diff --git a/Swerkin.podspec b/Swerkin.podspec index a278f34..239e11e 100644 --- a/Swerkin.podspec +++ b/Swerkin.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'Swerkin' - s.version = '0.0.1' + s.version = '0.0.2' s.summary = 'Library that contains the core components for UI Testing with KIF and Gherkin' # This description is used to generate tags and improve search results.