mirror of
https://github.com/facebookincubator/QuickLayout
synced 2026-04-21 13:37:22 +00:00
Run test (#4)
Summary: Be able to run test. https://github.com/facebookincubator/QuickLayout/issues/2 Pull Request resolved: https://github.com/facebookincubator/QuickLayout/pull/4 Reviewed By: saadhzahid Differential Revision: D88258295 Pulled By: constantine-fry fbshipit-source-id: 42fb707a4299bf22e20310d5d79368950ddb42d2
This commit is contained in:
parent
bb0f8bbcbf
commit
1dfb89f4c6
4 changed files with 49 additions and 14 deletions
27
.github/workflows/test.yml
vendored
Normal file
27
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Swift
|
||||
uses: swift-actions/setup-swift@v2
|
||||
with:
|
||||
swift-version: '6.0'
|
||||
|
||||
- name: Build
|
||||
run: swift build --build-tests
|
||||
|
||||
- name: Run tests
|
||||
run: swift test
|
||||
|
|
@ -21,18 +21,10 @@ let package = Package(
|
|||
name: "QuickLayout",
|
||||
targets: ["QuickLayout"]
|
||||
),
|
||||
.library(
|
||||
name: "QuickLayoutCore",
|
||||
targets: ["QuickLayoutCore"]
|
||||
),
|
||||
.library(
|
||||
name: "FastResultBuilder",
|
||||
targets: ["FastResultBuilder"]
|
||||
),
|
||||
.library(
|
||||
name: "QuickLayoutBridge",
|
||||
targets: ["QuickLayoutBridge"]
|
||||
),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.0")
|
||||
|
|
@ -42,7 +34,7 @@ let package = Package(
|
|||
name: "QuickLayout",
|
||||
dependencies: [
|
||||
"QuickLayoutMacro",
|
||||
"QuickLayoutBridge",
|
||||
.target(name: "QuickLayoutBridge", condition: .when(platforms: [.iOS])),
|
||||
],
|
||||
path: "Sources/QuickLayout/QuickLayout",
|
||||
exclude: [
|
||||
|
|
@ -55,11 +47,11 @@ let package = Package(
|
|||
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
|
||||
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
|
||||
],
|
||||
path: "Sources/QuickLayout/QuickLayoutMacro",
|
||||
path: "Sources/QuickLayout/QuickLayoutMacro"
|
||||
),
|
||||
.target(
|
||||
name: "QuickLayoutCore",
|
||||
path: "Sources/QuickLayout/QuickLayoutCore",
|
||||
path: "Sources/QuickLayout/QuickLayoutCore"
|
||||
),
|
||||
.target(
|
||||
name: "FastResultBuilder",
|
||||
|
|
@ -70,12 +62,23 @@ let package = Package(
|
|||
),
|
||||
.target(
|
||||
name: "QuickLayoutBridge",
|
||||
dependencies: ["FastResultBuilder", "QuickLayoutCore"],
|
||||
dependencies: [
|
||||
"FastResultBuilder",
|
||||
.target(name: "QuickLayoutCore", condition: .when(platforms: [.iOS])),
|
||||
],
|
||||
path: "Sources/QuickLayout/QuickLayoutBridge",
|
||||
exclude: [
|
||||
"__server_snapshot_tests__",
|
||||
"__tests__",
|
||||
]
|
||||
),
|
||||
],
|
||||
.testTarget(
|
||||
name: "QuickLayoutMacroTests",
|
||||
dependencies: [
|
||||
"QuickLayoutMacro",
|
||||
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
|
||||
],
|
||||
path: "Sources/QuickLayout/QuickLayoutMacroTests"
|
||||
),
|
||||
]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,4 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#if canImport(QuickLayoutBridge)
|
||||
@_exported import QuickLayoutBridge
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,11 +5,13 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import QuickLayoutMacro
|
||||
import SwiftSyntaxMacros
|
||||
import SwiftSyntaxMacrosTestSupport
|
||||
import XCTest
|
||||
|
||||
#if canImport(QuickLayoutMacro)
|
||||
@testable import QuickLayoutMacro
|
||||
|
||||
// patternlint-disable meta-subclass-view
|
||||
|
||||
let testMacros: [String: Macro.Type] = [
|
||||
|
|
@ -476,3 +478,4 @@ class QuickLayoutTests: XCTestCase {
|
|||
)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue