Skip to content

Commit

Permalink
WIP: Add linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsci committed Nov 7, 2024
1 parent dfa65ef commit ed4d06c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
1 change: 1 addition & 0 deletions Sources/Lua/LuaFoundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions Sources/Lua/LuaState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/lua-test/LuaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import XCTest
import Lua
import CLua
import Foundation
import CoreFoundation

fileprivate func dummyFn(_ L: LuaState!) -> CInt {
return 0
Expand Down

0 comments on commit ed4d06c

Please sign in to comment.