diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7447d75e..71ae7e967 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,12 @@ name: CI on: - push: - branches: [main] pull_request: + push: branches: [main] jobs: - linux_build: + swiftwasm_build: runs-on: ubuntu-20.04 steps: @@ -25,8 +24,11 @@ jobs: shell: bash run: | set -ex - sudo xcode-select --switch /Applications/Xcode_12_beta.app/Contents/Developer/ - # swift test + sudo xcode-select --switch /Applications/Xcode_12.1.app/Contents/Developer/ + # avoid building unrelated products for testing by specifying the test product explicitly + swift build --product TokamakPackageTests + `xcrun --find xctest` .build/debug/TokamakPackageTests.xctest + xcodebuild -version cd "NativeDemo" xcodebuild -scheme iOS -destination 'generic/platform=iOS' \ diff --git a/Package.resolved b/Package.resolved index 7282461ad..3067a1c89 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/swiftwasm/JavaScriptKit.git", "state": { "branch": null, - "revision": "6e84a7003071ed3e9fa7f8d8266a272a36b84608", - "version": "0.7.2" + "revision": "8ba4135d5fd6a734c3771ef3fac66896bbcb0214", + "version": "0.8.0" } }, { diff --git a/Package.swift b/Package.swift index d1b526857..b4463396f 100644 --- a/Package.swift +++ b/Package.swift @@ -107,7 +107,7 @@ let package = Package( ), .testTarget( name: "TokamakTests", - dependencies: ["TokamakDemo", "TokamakTestRenderer"] + dependencies: ["TokamakTestRenderer"] ), ] ) diff --git a/Sources/TokamakDemo/URLHashDemo.swift b/Sources/TokamakDemo/URLHashDemo.swift index 0098d7949..823c39aff 100644 --- a/Sources/TokamakDemo/URLHashDemo.swift +++ b/Sources/TokamakDemo/URLHashDemo.swift @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if os(WASI) import JavaScriptKit import TokamakDOM @@ -50,3 +51,4 @@ struct URLHashDemo: View { } } } +#endif diff --git a/Tests/TokamakTests/ColorTests.swift b/Tests/TokamakTests/ColorTests.swift index 6d4c2f5fc..56cf629e0 100644 --- a/Tests/TokamakTests/ColorTests.swift +++ b/Tests/TokamakTests/ColorTests.swift @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import TokamakCore +@testable import TokamakCore import XCTest final class ColorTests: XCTestCase { func testHexColors() { let env = EnvironmentValues() - guard let color = Color(hex: "#FF00FF")?._evaluate(env) else { + guard let color = Color(hex: "#FF00FF")?.provider.resolve(in: env) else { XCTFail("Hexadecimal decoding failed") return } @@ -29,11 +29,11 @@ final class ColorTests: XCTestCase { XCTAssertEqual( color, - Color(hex: "FF00FF")?._evaluate(env), + Color(hex: "FF00FF")?.provider.resolve(in: env), "The '#' before a hex code produced a different output than without it" ) - guard let red = Color(hex: "#FF0000")?._evaluate(env) else { + guard let red = Color(hex: "#FF0000")?.provider.resolve(in: env) else { XCTFail("Hexadecimal decoding failed") return } @@ -42,7 +42,7 @@ final class ColorTests: XCTestCase { XCTAssertEqual(red.green, 0) XCTAssertEqual(red.blue, 0) - guard let green = Color(hex: "#00FF00")?._evaluate(env) else { + guard let green = Color(hex: "#00FF00")?.provider.resolve(in: env) else { XCTFail("Hexadecimal decoding failed") return } @@ -51,7 +51,7 @@ final class ColorTests: XCTestCase { XCTAssertEqual(green.green, 1) XCTAssertEqual(green.blue, 0) - guard let blue = Color(hex: "#0000FF")?._evaluate(env) else { + guard let blue = Color(hex: "#0000FF")?.provider.resolve(in: env) else { XCTFail("Hexadecimal decoding failed") return }