diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0607ae7..5998c32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: sudo apt-get install -y libjavascriptcoregtk-4.1-dev - run: pkg-config --libs javascriptcoregtk-4.1 - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Test (Debug) run: swift test --configuration debug - name: Test (Release) @@ -25,16 +25,16 @@ jobs: ios: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Test (Debug) - run: xcodebuild clean test -configuration Debug -scheme "JXKit" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16 Pro" + run: xcodebuild clean test -configuration Debug -scheme "JXKit" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 17" - name: Test (Release) - run: xcodebuild clean test -configuration Release -scheme "JXKit" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16 Pro" + run: xcodebuild clean test -configuration Release -scheme "JXKit" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 17" tvos: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Test (Debug) run: xcodebuild clean test -configuration Debug -scheme "JXKit" -sdk "appletvsimulator" -destination "platform=tvOS Simulator,name=Apple TV" - name: Test (Release) @@ -43,35 +43,9 @@ jobs: macos: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Test (Debug) run: swift test --configuration debug - name: Test (Release) run: swift test --configuration release -Xswiftc -enable-testing - api-doc: - runs-on: macos-latest - timeout-minutes: 20 - steps: - - uses: actions/checkout@v2 - - name: Build documentation - run: | - swift -version - export SWIFTPM_ENABLE_COMMAND_PLUGINS=1 - export DOCC_JSON_PRETTYPRINT="YES" - - # insert the docc dependency - sed -I "" 's;^ dependencies: \[; dependencies: [ .package(name: "swift-docc-plugin", url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), ;1' Package.swift - - swift package --allow-writing-to-directory docs \ - generate-documentation --target JXKit \ - --disable-indexing \ - --transform-for-static-hosting \ - --hosting-base-path JXKit \ - --output-path docs - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: "." diff --git a/README.md b/README.md index 48a36f7..c2e4931 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # JXKit -[![Build Status][GitHubActionBadge]][ActionsLink] -[![Swift5 compatible][Swift5Badge]][Swift5Link] +[![JXKit CI](https://github.com/jectivex/JXKit/actions/workflows/ci.yml/badge.svg)](https://github.com/jectivex/JXKit/actions/workflows/ci.yml) ![Platform][SwiftPlatforms] - JXKit is a cross-plarform swift module for interfacing with `JavaScriptCore`. It provides a fluent API for working with an embedded @@ -148,8 +146,6 @@ Projects that are based on JXKit: [JXBridge]: https://github.com/jectivex/JXBridge [JavaScriptCore]: https://trac.webkit.org/wiki/JavaScriptCore -[GitHubActionBadge]: https://img.shields.io/github/workflow/status/jectivex/JXKit/JXKit%20CI - [Swift5Badge]: https://img.shields.io/badge/swift-5-orange.svg?style=flat [Swift5Link]: https://developer.apple.com/swift/ [SwiftPlatforms]: https://img.shields.io/badge/Platforms-macOS%20|%20iOS%20|%20tvOS%20|%20Linux-teal.svg diff --git a/Tests/JXKitTests/JXKitTests.swift b/Tests/JXKitTests/JXKitTests.swift index 52932aa..64bbdf5 100644 --- a/Tests/JXKitTests/JXKitTests.swift +++ b/Tests/JXKitTests/JXKitTests.swift @@ -48,7 +48,11 @@ final class JXKitTests: XCTestCase { XCTAssertEqual("65.4", try jxc.eval("new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 3 }).format(65.4321)").string) let yen = "new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(45.678)" + #if os(Linux) + XCTAssertEqual("¥46", try jxc.eval(yen).string) + #else XCTAssertEqual("¥46", try jxc.eval(yen).string) + #endif XCTAssertEqual("10/24/2022", try jxc.eval("new Intl.DateTimeFormat('en-US', {timeZone: 'UTC'}).format(new Date('2022-10-24'))").string) XCTAssertEqual("24/10/2022", try jxc.eval("new Intl.DateTimeFormat('fr-FR', {timeZone: 'UTC'}).format(new Date('2022-10-24'))").string)