Skip to content

Commit

Permalink
👷 MSUIKit 테스트 타겟 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftyJunnos committed Nov 25, 2023
1 parent b9c2b47 commit 14f5f04
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/Xcode_build_test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Xcode_build_test

env:
PACKAGE: MSCoreKit MSFoundation MSUIKit
PACKAGES_JSON: '["MSCoreKit", "MSFoundation", "MSUIKit"]'

on:
push:
Expand All @@ -15,27 +15,28 @@ on:
jobs:
prepare-matrix:
runs-on: macos-13
env:
working-directory: ./iOS
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Xcode
if: ${{ !env.ACT }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: Install jq
run: brew install jq

- name: Generate matrix
id: set-matrix
run: |
cd iOS
matrix="{\"include\":["
packages=$(echo $PACKAGES_JSON | jq -r '.[]')
first_entry=true
for package in ${{ env.PACKAGE }}; do
for package in $packages; do
cd $package
for scheme in $(xcodebuild -list | grep -E '^[[:space:]]*Schemes:' -A 10 | tail -n +2 | grep -v '^$'); do
if [[ $scheme != *"-Package" ]]; then
Expand Down Expand Up @@ -74,8 +75,7 @@ jobs:
fail-fast: false
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup Xcode
if: ${{ !env.ACT }}
Expand All @@ -94,14 +94,25 @@ jobs:
-destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15 Pro' \
clean build
prepare-test-matrix:
runs-on: macos-13
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
matrix="{\"package\": $PACKAGES_JSON}"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
xcode-test:
needs: prepare-test-matrix
runs-on: macos-13
strategy:
fail-fast: false
matrix:
package: ${{ env.PACKAGE }}
matrix: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4

- name: 🧪 Test ${{ matrix.package }}
run: |
echo "🧪 Testing ${{ matrix.package }}"
Expand Down
4 changes: 3 additions & 1 deletion iOS/MSUIKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ let package = Package(
// Codes
.target(name: .designSystem),
.target(name: .components,
dependencies: [.target(name: .designSystem)])
dependencies: [.target(name: .designSystem)]),
// Tests
.testTarget(name: .designSystem.testTarget,
dependencies: ["MSDesignSystem"])
],
swiftLanguageVersions: [.v5]
)
10 changes: 10 additions & 0 deletions iOS/MSUIKit/Tests/MSDesignSystemTests/MSDesignSystemTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// MSDesignSystemTests.swift
// MSUIKit
//
// Created by 이창준 on 11/26/23.
//

import XCTest

final class MSDesignSystemTests: XCTestCase { }
Empty file removed iOS/MSUIKit/Tests/gitkeep
Empty file.

0 comments on commit 14f5f04

Please sign in to comment.