parent
925494e7d5
commit
c5e5123341
@ -1,4 +1,4 @@
|
|||||||
name: build & run tests
|
name: build & run tests (NIX)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -13,10 +13,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
build-type: [Release] # Debug
|
build-type: [Release] # Debug
|
||||||
lua: ["lua 5.1", "lua 5.2", "lua 5.3", "luajit 2.0"]
|
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:
|
include:
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
macos_build_target: 10.0
|
macos_build_target: 10.0
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -31,12 +31,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install hererocks
|
pip install hererocks
|
||||||
hererocks lua-pkg --${{ matrix.lua }} -rlatest
|
hererocks lua-pkg --${{ matrix.lua }} -rlatest
|
||||||
- name: Configure CMake
|
source ${{github.workspace}}/lua-pkg/bin/activate
|
||||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DLUA_INCLUDE_DIR="${{github.workspace}}/lua-pkg/include"
|
|
||||||
- name: Build
|
- name: Configure CMake && build
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}}
|
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
|
- name: Test
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
|
env:
|
||||||
|
STRESS: 1
|
||||||
run: |
|
run: |
|
||||||
source ${{github.workspace}}/lua-pkg/bin/activate
|
${{github.workspace}}/lua-pkg/bin/lua ../tests/lua/run_tests
|
||||||
STRESS=1 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)
|
FILE(GLOB LUA_SOURCES src/lua/*.lua)
|
||||||
|
|
||||||
add_library(effil SHARED ${SOURCES})
|
add_library(effil SHARED ${SOURCES})
|
||||||
target_link_libraries(effil ${LUA_LIBRARY})
|
if (WIN32 OR WIN64)
|
||||||
if (WIN32)
|
target_link_libraries(effil ${LUA_LIBRARY})
|
||||||
set_target_properties(effil PROPERTIES
|
set_target_properties(effil PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
SUFFIX .dll)
|
SUFFIX .dll)
|
||||||
|
|||||||
@ -47,29 +47,26 @@ test.channel_stress.with_multiple_threads = function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: fix it for Windows
|
test.channel_stress.timed_read = function ()
|
||||||
if not os.getenv("APPVEYOR") then
|
local chan = effil.channel()
|
||||||
test.channel_stress.timed_read = function ()
|
local delayed_writer = function(channel, delay)
|
||||||
local chan = effil.channel()
|
require("effil").sleep(delay)
|
||||||
local delayed_writer = function(channel, delay)
|
channel:push("hello!")
|
||||||
require("effil").sleep(delay)
|
|
||||||
channel:push("hello!")
|
|
||||||
end
|
|
||||||
effil.thread(delayed_writer)(chan, 70)
|
|
||||||
|
|
||||||
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)
|
|
||||||
end
|
|
||||||
check_time(2, 2, nil, nil) -- second by default
|
|
||||||
check_time(2, 2, 's', nil)
|
|
||||||
check_time(60, 1, 'm', nil)
|
|
||||||
|
|
||||||
local start_time = os.time()
|
|
||||||
test.equal(chan:pop(10), "hello!")
|
|
||||||
test.is_true(os.time() < start_time + 10)
|
|
||||||
end
|
end
|
||||||
|
effil.thread(delayed_writer)(chan, 70)
|
||||||
|
|
||||||
|
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, 2)
|
||||||
|
end
|
||||||
|
check_time(2, 2, nil, nil) -- second by default
|
||||||
|
check_time(2, 2, 's', nil)
|
||||||
|
check_time(60, 1, 'm', nil)
|
||||||
|
|
||||||
|
local start_time = os.time()
|
||||||
|
test.equal(chan:pop(10), "hello!")
|
||||||
|
test.is_true(os.time() < start_time + 10)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- regress for channel returns
|
-- regress for channel returns
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user