Skip to content

Commit

Permalink
Merge pull request #11 from yumemi-inc/github_action_ci
Browse files Browse the repository at this point in the history
github action でUnit テストを回すための yaml 作成
  • Loading branch information
askldfghj authored Jan 30, 2024
2 parents 42cc717 + f1c68d0 commit 66e3dbb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 164 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: iOS starter workflow

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "session/*" ]

jobs:
build:
name: testWorkflow
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: UnitTest
run: set -o pipefail && xcodebuild test -project ios-training-bjung.xcodeproj/ -scheme ios-training-bjung -resultBundlePath TestResults -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 14" | xcbeautify

- uses: kishikawakatsumi/xcresulttool@v1
with:
path: TestResults.xcresult
if: success() || failure()
107 changes: 0 additions & 107 deletions ios-training-bjung.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
10B89C5A2B16C3DC001C0E96 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 10B89C592B16C3DC001C0E96 /* Assets.xcassets */; };
10B89C5D2B16C3DC001C0E96 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 10B89C5B2B16C3DC001C0E96 /* LaunchScreen.storyboard */; };
10B89C682B16C3DC001C0E96 /* ios_training_bjungTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10B89C672B16C3DC001C0E96 /* ios_training_bjungTests.swift */; };
10B89C722B16C3DC001C0E96 /* ios_training_bjungUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10B89C712B16C3DC001C0E96 /* ios_training_bjungUITests.swift */; };
10B89C742B16C3DC001C0E96 /* ios_training_bjungUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10B89C732B16C3DC001C0E96 /* ios_training_bjungUITestsLaunchTests.swift */; };
10B89C822B16C807001C0E96 /* YumemiWeather in Frameworks */ = {isa = PBXBuildFile; productRef = 10B89C812B16C807001C0E96 /* YumemiWeather */; };
10D758C32B1EC5D1002E4EB6 /* Router.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10D758C22B1EC5D1002E4EB6 /* Router.swift */; };
10D758C52B1EDA55002E4EB6 /* FirstView.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 10D758C42B1EDA55002E4EB6 /* FirstView.storyboard */; };
Expand All @@ -37,13 +35,6 @@
remoteGlobalIDString = 10B89C4C2B16C3DB001C0E96;
remoteInfo = "ios-training-bjung";
};
10B89C6E2B16C3DC001C0E96 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 10B89C452B16C3DB001C0E96 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 10B89C4C2B16C3DB001C0E96;
remoteInfo = "ios-training-bjung";
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
Expand All @@ -61,8 +52,6 @@
10B89C5E2B16C3DC001C0E96 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
10B89C632B16C3DC001C0E96 /* ios-training-bjungTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ios-training-bjungTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
10B89C672B16C3DC001C0E96 /* ios_training_bjungTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ios_training_bjungTests.swift; sourceTree = "<group>"; };
10B89C6D2B16C3DC001C0E96 /* ios-training-bjungUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ios-training-bjungUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
10B89C712B16C3DC001C0E96 /* ios_training_bjungUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ios_training_bjungUITests.swift; sourceTree = "<group>"; };
10B89C732B16C3DC001C0E96 /* ios_training_bjungUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ios_training_bjungUITestsLaunchTests.swift; sourceTree = "<group>"; };
10D758C22B1EC5D1002E4EB6 /* Router.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = "<group>"; };
10D758C42B1EDA55002E4EB6 /* FirstView.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = FirstView.storyboard; sourceTree = "<group>"; };
Expand All @@ -88,13 +77,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
10B89C6A2B16C3DC001C0E96 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand Down Expand Up @@ -158,7 +140,6 @@
children = (
10B89C4D2B16C3DB001C0E96 /* ios-training-bjung.app */,
10B89C632B16C3DC001C0E96 /* ios-training-bjungTests.xctest */,
10B89C6D2B16C3DC001C0E96 /* ios-training-bjungUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -193,7 +174,6 @@
10B89C702B16C3DC001C0E96 /* ios-training-bjungUITests */ = {
isa = PBXGroup;
children = (
10B89C712B16C3DC001C0E96 /* ios_training_bjungUITests.swift */,
10B89C732B16C3DC001C0E96 /* ios_training_bjungUITestsLaunchTests.swift */,
);
path = "ios-training-bjungUITests";
Expand Down Expand Up @@ -240,24 +220,6 @@
productReference = 10B89C632B16C3DC001C0E96 /* ios-training-bjungTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
10B89C6C2B16C3DC001C0E96 /* ios-training-bjungUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 10B89C7D2B16C3DC001C0E96 /* Build configuration list for PBXNativeTarget "ios-training-bjungUITests" */;
buildPhases = (
10B89C692B16C3DC001C0E96 /* Sources */,
10B89C6A2B16C3DC001C0E96 /* Frameworks */,
10B89C6B2B16C3DC001C0E96 /* Resources */,
);
buildRules = (
);
dependencies = (
10B89C6F2B16C3DC001C0E96 /* PBXTargetDependency */,
);
name = "ios-training-bjungUITests";
productName = "ios-training-bjungUITests";
productReference = 10B89C6D2B16C3DC001C0E96 /* ios-training-bjungUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -275,10 +237,6 @@
CreatedOnToolsVersion = 14.2;
TestTargetID = 10B89C4C2B16C3DB001C0E96;
};
10B89C6C2B16C3DC001C0E96 = {
CreatedOnToolsVersion = 14.2;
TestTargetID = 10B89C4C2B16C3DB001C0E96;
};
};
};
buildConfigurationList = 10B89C482B16C3DB001C0E96 /* Build configuration list for PBXProject "ios-training-bjung" */;
Expand All @@ -299,7 +257,6 @@
targets = (
10B89C4C2B16C3DB001C0E96 /* ios-training-bjung */,
10B89C622B16C3DC001C0E96 /* ios-training-bjungTests */,
10B89C6C2B16C3DC001C0E96 /* ios-training-bjungUITests */,
);
};
/* End PBXProject section */
Expand All @@ -323,13 +280,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
10B89C6B2B16C3DC001C0E96 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -360,15 +310,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
10B89C692B16C3DC001C0E96 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
10B89C722B16C3DC001C0E96 /* ios_training_bjungUITests.swift in Sources */,
10B89C742B16C3DC001C0E96 /* ios_training_bjungUITestsLaunchTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
Expand All @@ -377,11 +318,6 @@
target = 10B89C4C2B16C3DB001C0E96 /* ios-training-bjung */;
targetProxy = 10B89C642B16C3DC001C0E96 /* PBXContainerItemProxy */;
};
10B89C6F2B16C3DC001C0E96 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 10B89C4C2B16C3DB001C0E96 /* ios-training-bjung */;
targetProxy = 10B89C6E2B16C3DC001C0E96 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down Expand Up @@ -612,40 +548,6 @@
};
name = Release;
};
10B89C7E2B16C3DC001C0E96 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "bjung.ios-training-bjungUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = "ios-training-bjung";
};
name = Debug;
};
10B89C7F2B16C3DC001C0E96 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "bjung.ios-training-bjungUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = "ios-training-bjung";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -676,15 +578,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
10B89C7D2B16C3DC001C0E96 /* Build configuration list for PBXNativeTarget "ios-training-bjungUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
10B89C7E2B16C3DC001C0E96 /* Debug */,
10B89C7F2B16C3DC001C0E96 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
Expand Down
1 change: 1 addition & 0 deletions ios-training-bjung/Common/Mapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum Mapper {
private static let dateFormatter: DateFormatter = {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
dateFormatter.timeZone = TimeZone(identifier: "Asia/Tokyo")
return dateFormatter
}()

Expand Down
7 changes: 0 additions & 7 deletions ios-training-bjungTests/HomePresenterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,4 @@ final class HomePresenterTests: XCTestCase {
wait(for: [expectation], timeout: 10.0)
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}

}
15 changes: 6 additions & 9 deletions ios-training-bjungTests/ios_training_bjungTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ final class ios_training_bjungTests: XCTestCase {

func testMapperJsonEncoder() throws {
// Setup
let calendar = Calendar(identifier: .gregorian)
var calendar = Calendar(identifier: .gregorian)
// GitHub Actions でタイムゾーンを指定する必要がある
calendar.timeZone = TimeZone(identifier: "Asia/Tokyo")!
let date = calendar.date(from: DateComponents(year: 2020, month: 4, day: 1, hour: 12, minute: 0, second: 0))!
let target = WeatherRequest(area: "Tokyo", date: date)

Expand All @@ -128,7 +130,8 @@ final class ios_training_bjungTests: XCTestCase {

func testMapperJsonDecoder() throws {
// Setup
let calendar = Calendar(identifier: .gregorian)
var calendar = Calendar(identifier: .gregorian)
calendar.timeZone = TimeZone(identifier: "Asia/Tokyo")!
let date = calendar.date(from: DateComponents(year: 2020, month: 4, day: 1, hour: 12, minute: 0, second: 0))!
let target = "{\"max_temperature\":25,\"date\":\"2020-04-01T12:00:00+09:00\",\"min_temperature\":7,\"weather_condition\":\"cloudy\"}"

Expand All @@ -140,11 +143,5 @@ final class ios_training_bjungTests: XCTestCase {
// Verify
XCTAssertEqual(result, expect)
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}

}
41 changes: 0 additions & 41 deletions ios-training-bjungUITests/ios_training_bjungUITests.swift

This file was deleted.

0 comments on commit 66e3dbb

Please sign in to comment.