Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/ci/SharedDesignSystem/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// swift-tools-version: 5.10

import PackageDescription

let package = Package(
name: "SharedDesignSystem",
platforms: [
.iOS(.v16),
.macOS(.v13),
.watchOS(.v9),
.tvOS(.v16)
],
products: [
.library(
name: "SharedDesignSystem",
targets: ["SharedDesignSystem"]),
],
targets: [
.target(
name: "SharedDesignSystem"),
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import SwiftUI

public struct TYButtonStyle: ButtonStyle {
public init() {}

public func makeBody(configuration: Self.Configuration) -> some View {
configuration.label
.padding(.all, 8.0)
.overlay(RoundedRectangle(cornerRadius: 10)
.stroke(Color.red, lineWidth: 1.0)
.frame(width: 200, height: 50, alignment: .center)
)
.scaleEffect(configuration.isPressed ? 0.9 : 1.0)
}
}

public struct TYTextFieldStyle: TextFieldStyle {
public init() {}

public func _body(configuration: TextField<Self._Label>) -> some View {
configuration
.padding(.horizontal, 8.0)
.padding(.vertical, 16.0)
.background(RoundedRectangle(cornerRadius: 10)
.strokeBorder(Color.red, lineWidth: 1.0))
}
}

public struct TestySceneBackground: View {
public init() {}

public var body: some View {
LinearGradient(
colors: [
Color(red: 0.07, green: 0.11, blue: 0.22),
Color(red: 0.12, green: 0.32, blue: 0.48),
Color(red: 0.78, green: 0.88, blue: 0.94)
],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
.overlay(alignment: .topLeading) {
Circle()
.fill(Color.white.opacity(0.20))
.frame(width: 280, height: 280)
.blur(radius: 24)
.offset(x: -70, y: -110)
}
.overlay(alignment: .bottomTrailing) {
Circle()
.fill(Color.cyan.opacity(0.22))
.frame(width: 340, height: 340)
.blur(radius: 30)
.offset(x: 70, y: 120)
}
.ignoresSafeArea()
}
}

public struct TestyGlassButtonStyle: ButtonStyle {
public init() {}

public func makeBody(configuration: Configuration) -> some View {
configuration.label
.font(.headline)
.foregroundStyle(.primary)
.frame(maxWidth: .infinity)
.frame(minHeight: 54)
.padding(.horizontal, 18)
.background {
RoundedRectangle(cornerRadius: 20, style: .continuous)
.fill(.ultraThinMaterial)
}
.overlay {
RoundedRectangle(cornerRadius: 20, style: .continuous)
.stroke(Color.white.opacity(0.28), lineWidth: 1)
}
.scaleEffect(configuration.isPressed ? 0.97 : 1.0)
.opacity(configuration.isPressed ? 0.92 : 1.0)
.animation(.easeOut(duration: 0.18), value: configuration.isPressed)
}
}

public struct TestyGlassTextFieldStyle: TextFieldStyle {
public init() {}

public func _body(configuration: TextField<Self._Label>) -> some View {
configuration
.padding(.horizontal, 14)
.padding(.vertical, 14)
.background {
RoundedRectangle(cornerRadius: 18, style: .continuous)
.fill(.ultraThinMaterial)
}
.overlay {
RoundedRectangle(cornerRadius: 18, style: .continuous)
.stroke(Color.white.opacity(0.22), lineWidth: 1)
}
}
}

public struct TestyScreenModifier: ViewModifier {
public init() {}

public func body(content: Content) -> some View {
ZStack {
TestySceneBackground()
content
}
#if os(iOS)
.toolbarBackground(.hidden, for: .navigationBar)
#endif
}
}

public struct TestyGlassCardModifier: ViewModifier {
public init() {}

public func body(content: Content) -> some View {
content
.padding(18)
.background {
RoundedRectangle(cornerRadius: 28, style: .continuous)
.fill(.ultraThinMaterial)
}
.overlay {
RoundedRectangle(cornerRadius: 28, style: .continuous)
.stroke(Color.white.opacity(0.22), lineWidth: 1)
}
.shadow(color: .black.opacity(0.12), radius: 20, y: 10)
}
}

public extension View {
func testyScreen() -> some View {
modifier(TestyScreenModifier())
}

func testyGlassCard() -> some View {
modifier(TestyGlassCardModifier())
}
}
132 changes: 93 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,104 @@
name: Swift Package Cross-Platform CI (iOS-GUI & Linux-CUI)
name: Testy CI

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

# ワークフロー全体で Node 24 への移行を先取りして警告を消す
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
permissions:
contents: read

jobs:
test:
name: Test on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
# 1. iOS (GUI環境・UIKit依存)
- platform: iOS
os: macos-15
run_cmd: "xcodebuild test -scheme \"${{ github.event.repository.name }}\" -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' -quiet"

# 2. Linux (CUI環境・デーモン)
- platform: Linux
os: ubuntu-latest
run_cmd: "swift test -v"
ios-build:
name: Build iOS app
runs-on: macos-15
steps:
- name: Checkout Testy
uses: actions/checkout@v5
with:
path: Testy

- name: Show Xcode and Swift versions
working-directory: Testy
run: |
xcodebuild -version
swift --version

- name: Build Testy for iOS
working-directory: Testy
run: xcodebuild -project Testy.xcodeproj -scheme Testy -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO build

unit-test:
name: Run Swift package tests
runs-on: macos-15
steps:
- name: Checkout Testy
uses: actions/checkout@v5
with:
path: Testy

- name: Show Swift version
working-directory: Testy
run: swift --version

- name: Resolve dependencies
working-directory: Testy
run: swift package resolve

- name: Run tests
working-directory: Testy
run: swift test -v

linux-cross-build:
name: Cross-build Linux static SDK
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2

# 【iOSのみ】Xcode(Swift 6.0を含む環境)を選択
- name: Select Xcode Version (macOS)
if: matrix.platform == 'iOS'
run: sudo xcode-select -s /Applications/Xcode_16.0.app

# 【Linuxのみ】Swift 6.0 ツールチェーンをセットアップ
- name: Setup Swift (Linux)
if: matrix.platform == 'Linux'
uses: swift-actions/setup-swift@v3
- name: Checkout Testy
uses: actions/checkout@v5
with:
path: Testy

- name: Restore Swiftly cache
id: swiftly-cache
uses: actions/cache@v5
with:
swift-version: '6.0'
path: |
~/.swiftly
~/Library/Developer/Toolchains
key: ${{ runner.os }}-swiftly-6.1.2-v1

- name: Install Swift 6.1.2 toolchain
if: steps.swiftly-cache.outputs.cache-hit != 'true'
run: |
curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory
~/.swiftly/bin/swiftly init --quiet-shell-followup
. "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh"
hash -r
swiftly install 6.1.2

- name: Show Swift 6.1.2 toolchain
run: "$HOME/Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/bin/swift --version"

- name: Restore Static Linux SDK cache
id: static-linux-sdk-cache
uses: actions/cache@v5
with:
path: ~/Library/org.swift.swiftpm/swift-sdks
key: ${{ runner.os }}-swift-6.1.2-static-linux-sdk-0.0.1-v1

- name: Install Static Linux SDK
if: steps.static-linux-sdk-cache.outputs.cache-hit != 'true'
run: |
"$HOME/Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/bin/swift" sdk install \
https://download.swift.org/swift-6.1.2-release/static-sdk/swift-6.1.2-RELEASE/swift-6.1.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz \
--checksum df0b40b9b582598e7e3d70c82ab503fd6fbfdff71fd17e7f1ab37115a0665b3b

- name: Show installed Swift SDKs
run: "$HOME/Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/bin/swift sdk list"

# マトリックスで定義したそれぞれのテストコマンドを実行
- name: Run Tests
run: ${{ matrix.run_cmd }}
- name: Cross-build Testy for Linux
working-directory: Testy
run: |
"$HOME/Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/bin/swift" build -v --swift-sdk x86_64-swift-linux-musl --build-path .build/linux-musl
Loading