-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix import issue See more info here swiftlang/swift#65849 (comment) * FIx compile warning and add codecov support * [NFC] Fix non-Darwin platform test issue
- Loading branch information
Showing
41 changed files
with
202 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: macOS | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
macos_test: | ||
name: Execute tests on macOS | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-13 | ||
xcode-version: "15.0" # Swift 5.9.0 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Xcode | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: ${{ matrix.xcode-version }} | ||
- name: Swift version | ||
run: swift --version | ||
- name: Build and run tests in debug mode with coverage | ||
run: | | ||
swift test \ | ||
-c debug \ | ||
-Xswiftc -warnings-as-errors \ | ||
--enable-code-coverage \ | ||
--build-path .build-test-debug | ||
xcrun llvm-cov show \ | ||
-instr-profile=.build-test-debug/debug/codecov/default.profdata \ | ||
.build-test-debug/debug/OpenSwiftUIPackageTests.xctest/Contents/MacOS/OpenSwiftUIPackageTests \ | ||
> coverage.txt | ||
- name: Build and run tests in debug mode with TSan | ||
run: | | ||
swift test \ | ||
-c debug \ | ||
--sanitize thread \ | ||
-Xswiftc -warnings-as-errors \ | ||
--build-path .build-test-debug-sanitize-thread | ||
- name: Build and run tests in release mode | ||
run: | | ||
swift test \ | ||
-c release \ | ||
-Xswiftc -warnings-as-errors \ | ||
--enable-code-coverage \ | ||
--build-path .build-test-release | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Ubuntu | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
ubuntu_test: | ||
name: Execute tests on Ubuntu | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
swift_version: ["5.9.1"] | ||
runs-on: ubuntu-22.04 | ||
container: swift:${{ matrix.swift_version }}-jammy | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Building and running tests in debug mode with coverage | ||
run: | | ||
swift test \ | ||
-c debug \ | ||
-Xswiftc -warnings-as-errors \ | ||
--enable-code-coverage \ | ||
--build-path .build-test-debug | ||
llvm-cov show \ | ||
-instr-profile=.build-test-debug/debug/codecov/default.profdata \ | ||
.build-test-debug/debug/OpenSwiftUIPackageTests.xctest \ | ||
> coverage.txt | ||
- name: Building and running tests in debug mode with TSan | ||
run: | | ||
swift test \ | ||
-c debug \ | ||
--sanitize thread \ | ||
--build-path .build-test-debug-sanitize-thread | ||
- name: Building and running tests in release mode | ||
run: | | ||
swift test \ | ||
-c release \ | ||
-Xswiftc -warnings-as-errors \ | ||
--build-path .build-test-release | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
Sources/OpenSwiftUI/DataAndStorage/EnvironmentValues/EnvironmentValues+controlSize.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// EnvironmentValues+controlSize.swift | ||
// OpenSwiftUI | ||
// | ||
// Created by Kyle on 2023/11/5. | ||
// Lastest Version: iOS 15.5 | ||
// Status: Complete | ||
// ID: 50E368DED9ACE8B6BEC08FF7781AF4B1 | ||
|
||
private struct ControlSizeKey: EnvironmentKey { | ||
static let defaultValue: ControlSize = .regular | ||
} | ||
|
||
extension EnvironmentValues { | ||
@inline(__always) | ||
public var controlSize: ControlSize { | ||
get { self[ControlSizeKey.self] } | ||
set { self[ControlSizeKey.self] = newValue } | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...Internal/EnvironmentKeys/EnabledKey.swift → ...tValues/EnvironmentValues+isEnabled.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// EnabledKey.swift | ||
// EnvironmentValues+isEnabled.swift | ||
// OpenSwiftUI | ||
// | ||
// Created by Kyle on 2023/10/9. | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ | |
// Lastest Version: iOS 15.5 | ||
// Status: Complete | ||
|
||
import Foundation | ||
|
||
final class Box<A> { | ||
let value: A | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.