parent
925494e7d5
commit
c5e5123341
@ -1,4 +1,4 @@
|
||||
name: build & run tests
|
||||
name: build & run tests (NIX)
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -13,7 +13,7 @@ jobs:
|
||||
matrix:
|
||||
build-type: [Release] # Debug
|
||||
lua: ["lua 5.1", "lua 5.2", "lua 5.3", "luajit 2.0"]
|
||||
os: ["macos-latest", "ubuntu-latest"] # "windows-latest"
|
||||
os: ["macos-latest", "ubuntu-latest"]
|
||||
include:
|
||||
- os: macos-latest
|
||||
macos_build_target: 10.0
|
||||
@ -31,12 +31,16 @@ jobs:
|
||||
run: |
|
||||
pip install hererocks
|
||||
hererocks lua-pkg --${{ matrix.lua }} -rlatest
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DLUA_INCLUDE_DIR="${{github.workspace}}/lua-pkg/include"
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}}
|
||||
source ${{github.workspace}}/lua-pkg/bin/activate
|
||||
|
||||
- name: Configure CMake && build
|
||||
run: |
|
||||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DLUA_INCLUDE_DIR="${{github.workspace}}/lua-pkg/include"
|
||||
cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}}
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
env:
|
||||
STRESS: 1
|
||||
run: |
|
||||
source ${{github.workspace}}/lua-pkg/bin/activate
|
||||
STRESS=1 lua ../tests/lua/run_tests
|
||||
${{github.workspace}}/lua-pkg/bin/lua ../tests/lua/run_tests
|
||||
48
.github/workflows/win_ci.yml
vendored
Normal file
48
.github/workflows/win_ci.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: build & run tests (Win)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build-type: [Release] # Debug
|
||||
lua: ["lua 5.1", "lua 5.2", "lua 5.3", "luajit 2.0"]
|
||||
os: ["windows-2016"]
|
||||
platform: [
|
||||
{"forLua": "vs_32", "forCMake": "Win32"},
|
||||
{"forLua": "vs_64", "forCMake": "x64"},
|
||||
]
|
||||
exclude:
|
||||
- lua: "luajit 2.0"
|
||||
platform: {"forLua": "vs_32", "forCMake": "Win32"}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: Setup env
|
||||
run: |
|
||||
pip install hererocks
|
||||
hererocks lua-pkg --${{ matrix.lua }} -rlatest --target ${{matrix.platform.forLua}}
|
||||
cmd ${{github.workspace}}\lua-pkg\bin\activate
|
||||
|
||||
- name: Configure CMake & build
|
||||
run: |
|
||||
cmake -A ${{matrix.platform.forCMake}} -B ${{github.workspace}}\build -DLUA_INCLUDE_DIR="${{github.workspace}}/lua-pkg/include" -DLUA_LIBRARY="${{github.workspace}}/lua-pkg/lib/lua*.lib"
|
||||
cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}}
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
env:
|
||||
STRESS: 1
|
||||
run: |
|
||||
${{github.workspace}}/lua-pkg/bin/lua ../tests/lua/run_tests
|
||||
@ -41,8 +41,8 @@ FILE(GLOB SOURCES src/cpp/*.cpp src/cpp/*.h)
|
||||
FILE(GLOB LUA_SOURCES src/lua/*.lua)
|
||||
|
||||
add_library(effil SHARED ${SOURCES})
|
||||
if (WIN32 OR WIN64)
|
||||
target_link_libraries(effil ${LUA_LIBRARY})
|
||||
if (WIN32)
|
||||
set_target_properties(effil PROPERTIES
|
||||
PREFIX ""
|
||||
SUFFIX .dll)
|
||||
|
||||
@ -47,8 +47,6 @@ test.channel_stress.with_multiple_threads = function ()
|
||||
end
|
||||
end
|
||||
|
||||
-- TODO: fix it for Windows
|
||||
if not os.getenv("APPVEYOR") then
|
||||
test.channel_stress.timed_read = function ()
|
||||
local chan = effil.channel()
|
||||
local delayed_writer = function(channel, delay)
|
||||
@ -60,7 +58,7 @@ if not os.getenv("APPVEYOR") then
|
||||
local function check_time(real_time, use_time, metric, result)
|
||||
local start_time = os.time()
|
||||
test.equal(chan:pop(use_time, metric), result)
|
||||
test.almost_equal(os.time(), start_time + real_time, 1)
|
||||
test.almost_equal(os.time(), start_time + real_time, 2)
|
||||
end
|
||||
check_time(2, 2, nil, nil) -- second by default
|
||||
check_time(2, 2, 's', nil)
|
||||
@ -70,7 +68,6 @@ if not os.getenv("APPVEYOR") then
|
||||
test.equal(chan:pop(10), "hello!")
|
||||
test.is_true(os.time() < start_time + 10)
|
||||
end
|
||||
end
|
||||
|
||||
-- regress for channel returns
|
||||
test.channel_stress.retun_tables = function ()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user