Skip to content

Commit

Permalink
Merge pull request #4 from ondosee/feature/ci-build
Browse files Browse the repository at this point in the history
[Feature] :: CI 스크립트 구축
  • Loading branch information
uuuunseo authored Aug 22, 2024
2 parents 0282954 + 6c8bad8 commit 5894a75
Show file tree
Hide file tree
Showing 38 changed files with 258 additions and 304 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/ondosee-ios-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: ondosee-ios-ci

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "*" ]

env:
CACHED_DEPENDENCY_PATHS: ${{ github.workspace }}/Tuist/Dependencies
ONDOSEE_IOS_DISCORD_WEBHOOK: ${{ secrets.ONDOSEE_IOS_DISCORD_WEBHOOK }}

jobs:
prepare-dependency:
name: ⚙️ Prepare for CI
runs-on: macos-14

steps:
- uses: actions/checkout@v2
- uses: jdx/mise-action@v2
with:
xcode-version: 15.2

- name: Install tuist
run: mise install tuist

- name: Compute dependency cache key
id: compute_hash
run: echo "hash=${{ hashFiles('Tuist/Package.swift') }}" >> $GITHUB_OUTPUT

- name: Check dependency cache
uses: actions/cache@v3
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ steps.compute_hash.outputs.hash }}

- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit == ''
run: tuist install
outputs:
dependency_cache_key: ${{ steps.compute_hash.outputs.hash }}

test:
name: 🧪 Test
runs-on: macos-14
needs: prepare-dependency

steps:
- uses: actions/checkout@v2
with:
xcode-version: 15.2
- uses: jdx/mise-action@v2

- name: Install tuist
run: mise install tuist

- name: Check dependency cache
uses: actions/cache@v3
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ needs.prepare-dependency.outputs.dependency_cache_key }}

- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: tuist install

- name: Test with tuist
run: TUIST_ENV=CI tuist test --no-selective-testing

- name: ondosee iOS Test Success Discord Notification
uses: sarisia/actions-status-discord@v1
if: ${{ success() }}
with:
title: "✅ 온도씨 iOS Test 성공 !"
description: "Success to test 🧩"
webhook: ${{ env.ONDOSEE_IOS_DISCORD_WEBHOOK }}
color: 0x43962A

- name: ondosee iOS Test Failed Discord Notification
uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
title: "❌ 온도씨 iOS Test 실패 .."
description: "Failed to test 🥺"
webhook: ${{ env.ONDOSEE_IOS_DISCORD_WEBHOOK }}
color: 0xBB3639

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ graph.dot
Derived/

### Tuist managed dependencies ###
Tuist/.build
Tuist/.build

XCConfig/*
XCConfig.zip
!XCConfig/Shared.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public extension TargetDependency {
static func core(name: String) -> Self {
return .project(target: name, path: .relativeToCore(name))
}
static func shated(name: String) -> Self {
static func shared(name: String) -> Self {
return .project(target: name, path: .relativeToShared(name))
}
static func userInterface(name: String) -> Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public extension TargetDependency {
path: .relativeToDomain(target.rawValue)
)
}

static func core(
target: ModulePaths.Core,
type: ModularTargetType = .sources
Expand All @@ -31,7 +31,7 @@ public extension TargetDependency {
path: .relativeToCore(target.rawValue)
)
}

static func shared(
target: ModulePaths.Shared,
type: ModularTargetType = .sources
Expand All @@ -41,7 +41,7 @@ public extension TargetDependency {
path: .relativeToShared(target.rawValue)
)
}

static func userInterface(
target: ModulePaths.UserInterface,
type: ModularTargetType = .sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public struct ProjectEnvironment {
public let env = ProjectEnvironment(
name: "ondosee",
organizationName: "com",
destinations: [.iPhone, .appleWatch],
deploymentTargets: .multiplatform(iOS: "16.0", watchOS: "9.0"),
destinations: .iOS,
deploymentTargets: .iOS("16.0"),
baseSetting: [:]
)
49 changes: 16 additions & 33 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,42 @@ import ProjectDescriptionHelpers

let configurations: [Configuration] = .default

let settings: Settings = .settings(
base: env.baseSetting,
configurations: configurations,
defaultSettings: .recommended
)
let settings: Settings =
.settings(
base: env.baseSetting,
configurations: configurations,
defaultSettings: .recommended
)

let scripts: [TargetScript] = generateEnvironment.scripts

let targets: [Target] = [
.target(
name: env.name,
destinations: env.destinations,
destinations: [.iPhone, .iPad],
product: .app,
bundleId: "\(env.organizationName).\(env.name)",
deploymentTargets: .iOS("16.0"),
infoPlist: .file(path: "iOS/Support/Info.plist"),
sources: ["iOS/Sources/**"],
resources: ["iOS/Resources/**"],
entitlements: .file(path: "iOS/Support/ondosee.entitlements"),
entitlements: "iOS/Support/ondosee.entitlements",
scripts: scripts,
dependencies: ModulePaths.Feature.allCases.map { TargetDependency.feature(target: $0) }
dependencies:
ModulePaths.Feature.allCases.map { TargetDependency.feature(target: $0) }
+ ModulePaths.Domain.allCases.map { TargetDependency.domain(target: $0) }
+ [
+
[
.core(target: .Networking),
.target(name: "\(env.name)Widget"),
.target(name: "\(env.name)WatchApp")
],
.target(name: "\(env.name)Widget")
],
settings: .settings(
base: env.baseSetting
)
),
.target(
name: "\(env.name)Widget",
destinations: [.iPhone],
destinations: [.iPhone, .iPad],
product: .appExtension,
bundleId: "\(env.organizationName).\(env.name).ondoseeWidget",
deploymentTargets: .iOS("16.0"),
Expand All @@ -52,27 +54,8 @@ let targets: [Target] = [
dependencies: [
.userInterface(target: .DesignSystem)
],
settings: .settings(
base: env.baseSetting
)
settings: settings
),
.target(
name: "\(env.name)WatchApp",
destinations: [.appleWatch],
product: .app,
bundleId: "\(env.organizationName).\(env.name).watchkitapp",
deploymentTargets: .watchOS("9.0"),
infoPlist: .file(path: "watchOS/Support/Info.plist"),
sources: ["watchOS/Sources/**"],
resources: ["watchOS/Resources/**"],
scripts: scripts,
dependencies: [
.userInterface(target: .DesignSystem)
],
settings: .settings(
base: env.baseSetting
)
)
]

let schemes: [Scheme] = [
Expand Down
25 changes: 25 additions & 0 deletions Projects/App/iOS-Widget/Resources/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import SwiftUI

@main
struct OndoseeIOSWidgetApp: App {
var body: some Scene {
WindowGroup {
EmptyView()
}
}
}
12 changes: 0 additions & 12 deletions Projects/App/iOS-Widget/Support/ondoseeWidget.entitlements
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
ondoseeWidget.plist
ondosee
Created by 정윤서 on 8/20/24.
Copyright (c) 2024 com. All rights reserved.
-->
<plist version="1.0">
<dict/>
</plist>

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5894a75

Please sign in to comment.