Skip to content

Commit 82fdc17

Browse files
committed
CI Test on Windows
1 parent bce1f3f commit 82fdc17

File tree

2 files changed

+68
-13
lines changed

2 files changed

+68
-13
lines changed

.github/workflows/ci.yml

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: "Unix build"
1+
name: "CI"
22

33
on: [push, pull_request]
44

55
jobs:
6-
test:
6+
unix:
77
strategy:
88
fail-fast: false
99
matrix:
@@ -39,8 +39,71 @@ jobs:
3939
4040
- name: Lint with luacheck
4141
run: |
42-
make lint
42+
luacheck -q .
4343
4444
- name: Busted tests
4545
run: |
46-
make test
46+
busted -o gtest -v spec
47+
48+
49+
windows:
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
lua: [
54+
#{name: "lua51", exe: "lua5.1", version: 5.1, incdir: "/mingw64/include/lua5.1/"}, #(two tests are failing)
55+
{name: "lua53", exe: "lua5.3", version: 5.3, incdir: "/mingw64/include/lua5.3/"},
56+
{name: "lua", exe: "lua", version: 5.4, incdir: "/mingw64/include/"},
57+
{name: "luajit", exe: "luajit", version: 5.1, incdir: "/mingw64/include/luajit-2.1/"}
58+
]
59+
60+
runs-on: windows-latest
61+
defaults:
62+
run:
63+
shell: msys2 {0}
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: msys2/setup-msys2@v2
67+
with:
68+
msystem: MINGW64
69+
update: true
70+
install: git
71+
make
72+
mingw-w64-x86_64-toolchain
73+
mingw-w64-x86_64-libvips
74+
mingw-w64-x86_64-openslide
75+
mingw-w64-x86_64-libheif
76+
mingw-w64-x86_64-libjxl
77+
mingw-w64-x86_64-imagemagick
78+
mingw-w64-x86_64-poppler
79+
mingw-w64-x86_64-lua-luarocks
80+
mingw-w64-x86_64-${{ matrix.lua.name }}
81+
82+
- if: matrix.lua.name == 'lua51'
83+
name: Install bitop
84+
run: |
85+
pacman --noconfirm -S mingw-w64-x86_64-lua51-bitop
86+
87+
- name: Lua dependencies
88+
run: |
89+
if [[ ${{ matrix.lua.exe }} == lua5.3 ]]; then
90+
cp /mingw64/etc/luarocks/config-5.{4,3}.lua
91+
fi
92+
luarocks config --scope system lua_version ${{ matrix.lua.version }}
93+
luarocks config --scope system lua_interpreter ${{ matrix.lua.exe }}.exe
94+
luarocks config --scope system variables.LUA_DIR /mingw64/bin
95+
luarocks config --scope system variables.LUA_INCDIR ${{ matrix.lua.incdir }}
96+
make dev
97+
if [[ ${{ matrix.lua.exe }} != luajit ]]; then make ffi; fi
98+
99+
- name: Add to PATH
100+
run: |
101+
echo $RUNNER_TEMP/msys64/mingw64/bin:$HOME/.luarocks/bin >> $GITHUB_PATH
102+
103+
- name: Lint with luacheck
104+
run: |
105+
luacheck.bat -q .
106+
107+
- name: Busted tests
108+
run: |
109+
busted.bat --lua=${{ matrix.lua.exe }} -o gtest -v spec

Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
DEV_ROCKS = "busted 2.2.0" "luacheck 1.1.2"
2-
BUSTED_ARGS ?= -o gtest -v
3-
TEST_CMD ?= busted $(BUSTED_ARGS)
42

5-
.PHONY: dev ffi bit lint test
3+
.PHONY: dev ffi bit
64

75
dev:
86
@for rock in $(DEV_ROCKS) ; do \
@@ -19,9 +17,3 @@ ffi:
1917

2018
bit:
2119
@luarocks install luabitop
22-
23-
lint:
24-
@luacheck -q .
25-
26-
test:
27-
@$(TEST_CMD) spec/

0 commit comments

Comments
 (0)