Skip to content

Commit

Permalink
Added TestBuidPackage to ensure Proton can be added without build iss…
Browse files Browse the repository at this point in the history
…ues as an package in another package (#124)
  • Loading branch information
rajdeep authored Jul 31, 2021
1 parent 4ef0396 commit a33ae45
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build

on:
push:
paths-ignore:
- 'docs/**'
push:
page_build:
pull_request:
branches: [ master ]
branches:
- master

jobs:
build:
Expand All @@ -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/[email protected]
- name: Build Example App
Expand Down
3 changes: 3 additions & 0 deletions Proton.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions TestBuildPackage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
32 changes: 32 additions & 0 deletions TestBuildPackage/Package.swift
Original file line number Diff line number Diff line change
@@ -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"]),
]
)
3 changes: 3 additions & 0 deletions TestBuildPackage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TestBuildPackage

A description of this package.
Original file line number Diff line number Diff line change
@@ -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!"
}
Original file line number Diff line number Diff line change
@@ -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!")
}
}

0 comments on commit a33ae45

Please sign in to comment.