99 description : ' Version of the C++ Server-side SDK to use for building and testing.'
1010 required : false
1111 default : ' launchdarkly-cpp-server-redis-source-v2.1.0'
12-
12+ rockspec :
13+ description : ' The rockspec file for the server-side SDK.'
14+ required : true
1315
1416runs :
1517 using : composite
@@ -32,78 +34,31 @@ runs:
3234 version : ${{ inputs.cpp-sdk-version }}
3335 path : cpp-sdk
3436
35- - uses : ./.github/actions/rockspec-names
36- id : rockspecs
37-
38- - name : Build Lua Server-side SDK
39- shell : bash
40- run : |
41- luarocks make ${{ steps.rockspecs.outputs.server }} \
42- LD_DIR=./cpp-sdk/build-dynamic/release
43-
44- - name : Build Lua Server-side SDK with Redis
45- shell : bash
46- run : |
47- luarocks make ${{ steps.rockspecs.outputs.server_redis }} \
48- LDREDIS_DIR=./cpp-sdk/build-dynamic/release
49-
50- - name : Run Lua Server-side SDK Tests
37+ - name : Build Package
5138 shell : bash
52- if : ${{ ! contains(inputs.lua-version, 'jit') }}
53- run : luarocks test ${{ steps.rockspecs.outputs.server }}
5439 env :
55- # Needed because boost isn't installed in default system paths, which is
56- # what the C++ Server-side SDK shared object expects.
57- LD_LIBRARY_PATH : ${{ steps.install-boost.outputs.BOOST_ROOT }}/lib
40+ CPP_PATH : ${{ github.workspace }}/cpp-sdk/build-dynamic/release
41+ run : |
42+ luarocks make ${{ inputs.rockspec }} \
43+ LD_DIR=$CPP_PATH \
44+ LDREDIS_DIR=$CPP_PATH
5845
59- - name : Run Lua Server-side SDK Tests (JIT)
46+ - name : Run Tests
6047 shell : bash
61- if : ${{ contains(inputs.lua-version, 'jit') }}
62- run : luajit test.lua
48+ run : luarocks test ${{ inputs.rockspec }}
6349 env :
6450 # Needed because boost isn't installed in default system paths, which is
6551 # what the C++ Server-side SDK shared object expects.
66- LD_LIBRARY_PATH : ${{ steps.install-boost.outputs.BOOST_ROOT }}/lib
67-
68- - name : Run Lua Server-side SDK with Redis Tests
69- shell : bash
70- if : ${{ ! contains(inputs.lua-version, 'jit') }}
71- run : luarocks test ${{ steps.rockspecs.outputs.server_redis }}
72- env :
73- # Needed because boost isn't installed in default system paths, which is
74- # what the C++ Server-side SDK shared object expects. Same for hiredis which is bundled
75- # with the SDK release.
76- LD_LIBRARY_PATH : ${{ steps.install-boost.outputs.BOOST_ROOT }}/lib;./cpp-sdk/build-dynamic/release/lib
77-
78- - name : Run Lua Server-side SDK with Redis Tests (JIT)
79- shell : bash
80- if : ${{ contains(inputs.lua-version, 'jit') }}
81- run : luajit test-redis.lua
82- env :
83- # Needed because boost isn't installed in default system paths, which is
84- # what the C++ Server-side SDK shared object expects. Same for hiredis which is bundled
85- # with the SDK release.
8652 LD_LIBRARY_PATH : ${{ steps.install-boost.outputs.BOOST_ROOT }}/lib;./cpp-sdk/build-dynamic/release/lib
53+ LUA_INTERPRETER : ${{ contains(inputs.lua-version, 'jit') && 'luajit' || 'lua' }}
8754
8855 - name : Run hello-lua-server example
8956 if : ${{ !contains(inputs.lua-version, 'jit') }}
9057 shell : bash
58+ run : ./scripts/interpreter.sh ./examples/hello-lua-server/hello.lua
9159 env :
9260 LD_SDK_KEY : " fake-sdk-key"
9361 # Needed because boost isn't installed in default system paths, which is
9462 # what the C++ Server-side SDK shared object expects.
9563 LD_LIBRARY_PATH : ${{ steps.install-boost.outputs.BOOST_ROOT }}/lib
96- run : |
97- lua ./examples/hello-lua-server/hello.lua
98-
99-
100- - name : Run hello-lua-server example (JIT)
101- if : ${{ contains(inputs.lua-version, 'jit') }}
102- shell : bash
103- env :
104- LD_SDK_KEY : " fake-sdk-key"
105- # Needed because boost isn't installed in default system paths, which is
106- # what the C++ Server-side SDK shared object expects.
107- LD_LIBRARY_PATH : ${{ steps.install-boost.outputs.BOOST_ROOT }}/lib
108- run : |
109- luajit ./examples/hello-lua-server/hello.lua
64+ LUA_INTERPRETER : ${{ contains(inputs.lua-version, 'jit') && 'luajit' || 'lua' }}
0 commit comments