@@ -13,35 +13,60 @@ jobs:
13
13
- os : " macos-latest"
14
14
lua-version : " 5.4"
15
15
libflag : " -bundle -undefined dynamic_lookup -all_load --coverage"
16
+ - os : " windows-latest"
17
+ toolchain : " msvc"
18
+ lua-version : " 5.4"
19
+ - os : " windows-latest"
20
+ lua-version : " luajit"
16
21
runs-on : ${{ matrix.os }}
17
22
18
23
steps :
19
24
- uses : actions/checkout@master
20
25
26
+ - name : Setup MSVC
27
+ # 'luarocks/gh-actions-lua' step requires msvc to build PUC-Rio Lua
28
+ # versions on Windows (LuaJIT will be built using MinGW/gcc).
29
+ if : ${{ matrix.toolchain == 'msvc' }}
30
+ uses : ilammy/msvc-dev-cmd@v1
31
+
21
32
- uses : luarocks/gh-actions-lua@master
22
33
with :
23
34
luaVersion : ${{ matrix.lua-version }}
24
35
25
36
- uses : luarocks/gh-actions-luarocks@master
26
37
27
- - name : Prep
38
+ - name : Prep luacov
39
+ run : |
40
+ luarocks install luacov
41
+
42
+ - name : Prep luacov-coveralls
43
+ # TODO Windows coverage
44
+ if : ${{ matrix.os != 'windows-latest' }}
28
45
run : |
29
46
pip install --user cpp-coveralls
47
+ # install luacov-coveralls, but avoid installing luafilesystem
30
48
luarocks install lua-path
31
49
luarocks install dkjson
32
- luarocks install luacov
33
- # install luacov-coveralls, but avoid installing luafilesystem
34
50
luarocks install luacov-coveralls --server=https://luarocks.org/dev --deps-mode=none
35
51
36
- - name : Build
52
+ - name : Unix Build
53
+ if : ${{ matrix.os != 'windows-latest' }}
37
54
run : |
38
55
luarocks make CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="${{ matrix.libflag }}"
39
56
57
+ - name : Windows Build
58
+ # TODO Windows coverage
59
+ if : ${{ matrix.os == 'windows-latest' }}
60
+ run : |
61
+ luarocks make
62
+
40
63
- name : Test
41
64
run : |
42
65
lua -lluacov tests/test.lua
43
66
44
67
- name : Coverage
68
+ # TODO Windows coverage
69
+ if : ${{ matrix.os != 'windows-latest' }}
45
70
run : |
46
71
export MY_PYTHON_VER=$(python -c 'import sys; print(".".join(sys.version.split(".")[0:2]))')
47
72
export PATH="/Users/runner/Library/Python/$MY_PYTHON_VER/bin:$PATH"
0 commit comments