Skip to content

Commit

Permalink
Github actions (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
InderKumarRathore committed Dec 20, 2024
1 parent 3457b37 commit 0258faa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and Test
run: |
xcodebuild \
-project DeviceGuru.xcodeproj \
-scheme DeviceGuru \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=18.1' \
test || exit 1
19 changes: 19 additions & 0 deletions DeviceGuru.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
OBJ_35 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_6 /* Package.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
1DA792682D15A63D00899406 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = OBJ_1 /* Project object */;
proxyType = 1;
remoteGlobalIDString = "DeviceGuru::DeviceGuru";
remoteInfo = DeviceGuru;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
1D82027E2807F3DE00CB9ECF /* DeviceGuruTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DeviceGuruTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1D8202802807F3DE00CB9ECF /* DeviceGuruTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceGuruTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -140,6 +150,7 @@
buildRules = (
);
dependencies = (
1DA792692D15A63D00899406 /* PBXTargetDependency */,
);
name = DeviceGuruTests;
productName = DeviceGuruTests;
Expand Down Expand Up @@ -268,6 +279,14 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
1DA792692D15A63D00899406 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = "DeviceGuru::DeviceGuru" /* DeviceGuru */;
targetProxy = 1DA792682D15A63D00899406 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
1D8202832807F3DE00CB9ECF /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import XCTest

@testable import DeviceGuru

// Run Test on iPhone 15 pro

final class HardwareDetailProviderImplementationTests: XCTestCase {

func testExample() {
let hardwareProvider = HardwareDetailProviderImplementation()
XCTAssertEqual(hardwareProvider.hardwareString, "iPhone16,1")
XCTAssertTrue(hardwareProvider.hardwareString.contains("iPhone"))
}
}

0 comments on commit 0258faa

Please sign in to comment.