diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 119548b..527152b 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -32,6 +32,36 @@ jobs: - name: Upload Pages artifact uses: actions/upload-pages-artifact@v2 + build-linux: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + - uses: swift-actions/setup-swift@v2 + - name: Build + run: swift build -v + - name: Run tests + run: swift test -v + + build-oss: + + runs-on: macos-13 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + - uses: swift-actions/setup-swift@v2 + - name: Build + run: swift build -v + - name: Run tests + run: swift test -v + deploy: needs: build if: ${{ github.ref == 'refs/heads/main' }} diff --git a/Sources/Lua/LuaFoundation.swift b/Sources/Lua/LuaFoundation.swift index 389ba49..e1b85d2 100644 --- a/Sources/Lua/LuaFoundation.swift +++ b/Sources/Lua/LuaFoundation.swift @@ -4,6 +4,7 @@ #if !LUASWIFT_NO_FOUNDATION // canImport(Foundation) import Foundation +import CoreFoundation import CLua /// Represents all the String encodings that this framework can convert strings to and from. diff --git a/Sources/Lua/LuaState.swift b/Sources/Lua/LuaState.swift index f59b1a7..05abb39 100644 --- a/Sources/Lua/LuaState.swift +++ b/Sources/Lua/LuaState.swift @@ -937,7 +937,12 @@ extension UnsafeMutablePointer where Pointee == lua_State { if let intVal = tointeger(index) { // Integers are returned type-erased (thanks to AnyHashable) meaning fewer cast restrictions in // eg tovalue() +#if LUASWIFT_NO_FOUNDATION return AnyHashable(intVal) +#else + // TODO: There's a big ol' comment to go here... + return AnyHashable(NSNumber(value: intVal)) +#endif } else { return tonumber(index) } diff --git a/Tests/lua-test/LuaTests.swift b/Tests/lua-test/LuaTests.swift index 4e3a08d..4243870 100644 --- a/Tests/lua-test/LuaTests.swift +++ b/Tests/lua-test/LuaTests.swift @@ -4,6 +4,8 @@ import XCTest import Lua import CLua +import Foundation +import CoreFoundation fileprivate func dummyFn(_ L: LuaState!) -> CInt { return 0