diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 984a3cd7..d83f7c9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,11 @@ name: Build on: - push: - paths-ignore: - - 'docs/**' + push: + page_build: pull_request: - branches: [ master ] + branches: + - master jobs: build: @@ -23,6 +23,8 @@ jobs: - uses: actions/checkout@v2 - name: Build and Test Proton run: xcodebuild build test -destination "name=iPhone 11 Pro" -scheme "Proton" + - name: Build and Test Proton as dependency in another package + run: xcodebuild build -destination "name=iPhone 11 Pro" -scheme "TestBuildPackage" - name: Capture Proton Code Coverage uses: codecov/codecov-action@v1.0.7 - name: Build Example App diff --git a/Proton.xcworkspace/contents.xcworkspacedata b/Proton.xcworkspace/contents.xcworkspacedata index b0ae3d3f..dacd3ec8 100644 --- a/Proton.xcworkspace/contents.xcworkspacedata +++ b/Proton.xcworkspace/contents.xcworkspacedata @@ -1,6 +1,9 @@ + + diff --git a/TestBuildPackage/.gitignore b/TestBuildPackage/.gitignore new file mode 100644 index 00000000..bb460e7b --- /dev/null +++ b/TestBuildPackage/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/TestBuildPackage/Package.swift b/TestBuildPackage/Package.swift new file mode 100644 index 00000000..f0eb66e8 --- /dev/null +++ b/TestBuildPackage/Package.swift @@ -0,0 +1,32 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "TestBuildPackage", + platforms: [ + .iOS(.v11), + .macOS(.v10_15) + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "TestBuildPackage", + targets: ["TestBuildPackage"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + .package(name: "Proton", path: "../") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "TestBuildPackage", + dependencies: ["Proton"]), + .testTarget( + name: "TestBuildPackageTests", + dependencies: ["TestBuildPackage"]), + ] +) diff --git a/TestBuildPackage/README.md b/TestBuildPackage/README.md new file mode 100644 index 00000000..8e333649 --- /dev/null +++ b/TestBuildPackage/README.md @@ -0,0 +1,3 @@ +# TestBuildPackage + +A description of this package. diff --git a/TestBuildPackage/Sources/TestBuildPackage/TestBuildPackage.swift b/TestBuildPackage/Sources/TestBuildPackage/TestBuildPackage.swift new file mode 100644 index 00000000..8af0d2af --- /dev/null +++ b/TestBuildPackage/Sources/TestBuildPackage/TestBuildPackage.swift @@ -0,0 +1,8 @@ +import Proton + +// The purpose of this package is only to validate Proton as a dependency +// and ensure that imports like UIKit are not missed when adding a new file +// For ref: https://github.com/rajdeep/proton/pull/123 +struct TestBuildPackage { + var text = "Hello, World!" +} diff --git a/TestBuildPackage/Tests/TestBuildPackageTests/TestBuildPackageTests.swift b/TestBuildPackage/Tests/TestBuildPackageTests/TestBuildPackageTests.swift new file mode 100644 index 00000000..bae56ee2 --- /dev/null +++ b/TestBuildPackage/Tests/TestBuildPackageTests/TestBuildPackageTests.swift @@ -0,0 +1,11 @@ + import XCTest + @testable import TestBuildPackage + + final class TestBuildPackageTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(TestBuildPackage().text, "Hello, World!") + } + }