Skip to content

Commit

Permalink
SwiftFormat 수정 및 CI Yaml 파일에 SwiftFormat 동작 여부 확인 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteHyun committed Jan 24, 2024
1 parent f16da42 commit 032fa0a
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 112 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/ios.yml → .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
name: iOS starter workflow
name: iOS CI workflow

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [labeled, opened, synchronize, reopened]

jobs:
check-swift-format:
name: Check for Possible Changes with SwiftFormat
runs-on: macos-latest
steps:
- name: Code Checkout
uses: actions/checkout@v3
- name: Install Swiftformat
run: brew install swiftformat
- name: Run Swiftformat
run: swiftformat . --config .swiftformat
- name: Check for changes
run: |
git diff
if [[ `git status --porcelain` ]]; then
echo "Code was formatted. Failing the job."
exit 1
fi
build:
name: Build and Test default scheme using any available iPhone simulator
runs-on: macos-13
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/test.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
--importgrouping alpha
--enable acronyms
--acronyms "URL, ID, UUID, CVS"
--emptyBraces "linebreak"
--enable blankLineAfterImports
--enable blankLinesAroundMark
--enable blockComments
Expand Down
21 changes: 0 additions & 21 deletions Makefile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BAD4D98A2B5F8DD200C29132"
BuildableName = "SwiftCITestUITests.xctest"
BlueprintName = "SwiftCITestUITests"
ReferencedContainer = "container:SwiftCITest.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
22 changes: 0 additions & 22 deletions SwiftCITestTests/SwiftCITestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,4 @@
import XCTest

final class SwiftCITestTests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
measure {
// Put the code you want to measure the time of here.
}
}
}
29 changes: 0 additions & 29 deletions SwiftCITestUITests/SwiftCITestUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,4 @@
import XCTest

final class SwiftCITestUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.

// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false

// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()

// Use XCTAssert and related functions to verify your tests produce the correct results.
}

func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
20 changes: 0 additions & 20 deletions SwiftCITestUITests/SwiftCITestUITestsLaunchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,4 @@
import XCTest

final class SwiftCITestUITestsLaunchTests: XCTestCase {
override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}

override func setUpWithError() throws {
continueAfterFailure = false
}

func testLaunch() throws {
let app = XCUIApplication()
app.launch()

// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app

let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}

0 comments on commit 032fa0a

Please sign in to comment.