Skip to content

Commit 0d492f7

Browse files
kleisaukerolandlo
authored andcommitted
Fix Windows CI
1 parent a4c77b3 commit 0d492f7

File tree

2 files changed

+64
-66
lines changed

2 files changed

+64
-66
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -13,102 +13,101 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414

1515
steps:
16-
- uses: actions/checkout@v6
16+
- uses: actions/checkout@v6
1717

18-
- uses: leafo/gh-actions-lua@v12
19-
with:
20-
luaVersion: ${{ matrix.luaVersion }}
18+
- uses: leafo/gh-actions-lua@v12
19+
with:
20+
luaVersion: ${{ matrix.luaVersion }}
2121

22-
- uses: leafo/gh-actions-luarocks@v6
22+
- uses: leafo/gh-actions-luarocks@v6
2323

24-
- name: Install Ubuntu dependencies
25-
if: runner.os == 'Linux'
26-
run: |
27-
sudo apt-get update
28-
sudo apt-get install --no-install-recommends libvips-dev
24+
- name: Install Ubuntu dependencies
25+
if: runner.os == 'Linux'
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install --no-install-recommends libvips-dev
2929
30-
- name: Install macOS dependencies
31-
if: runner.os == 'macOS'
32-
run: |
33-
brew install vips
34-
echo "DYLD_LIBRARY_PATH=$(brew --prefix vips)/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
30+
- name: Install macOS dependencies
31+
if: runner.os == 'macOS'
32+
run: |
33+
brew install vips
34+
echo "DYLD_LIBRARY_PATH=$(brew --prefix vips)/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
3535
36-
- name: Install lua-vips
37-
run: |
38-
if [[ ${{ matrix.luaVersion }} == luajit* ]]; then
39-
luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
40-
fi
41-
luarocks make
36+
- name: Prepare LuaJIT environment
37+
if: startsWith(matrix.luaVersion, 'luajit')
38+
run: luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
4239

43-
- name: Lint with luacheck
44-
run: |
45-
luarocks install luacheck
46-
luacheck -q .
40+
- name: Install lua-vips
41+
run: luarocks make
4742

48-
- name: Busted tests
49-
run: |
50-
luarocks test spec/ -- -o gtest -v spec
43+
- name: Lint with luacheck
44+
run: |
45+
luarocks install luacheck
46+
luacheck -q .
5147
48+
- name: Busted tests
49+
run: luarocks test spec/ -- -o gtest -v spec
5250

5351
windows:
5452
strategy:
5553
fail-fast: false
5654
matrix:
57-
lua: [
58-
#{name: "lua51", exe: "lua5.1", version: 5.1, incdir: "/mingw64/include/lua5.1/"}, #(two tests are failing)
59-
{name: "lua53", exe: "lua5.3", version: 5.3, incdir: "/mingw64/include/lua5.3/"},
60-
{name: "lua", exe: "lua", version: 5.4, incdir: "/mingw64/include/"},
61-
{name: "luajit", exe: "luajit", version: 5.1, incdir: "/mingw64/include/luajit-2.1/"}
62-
]
55+
include:
56+
# Two tests are failing
57+
#- lua: { version: "5.1", msys2-name: "lua51", exe: "lua5.1" }
58+
- lua: { version: "5.3", msys2-name: "lua53", exe: "lua5.3" }
59+
- lua: { version: "5.4", msys2-name: "lua", exe: "lua" }
60+
- lua: { version: "5.1", msys2-name: "luajit", exe: "luajit" }
6361

6462
runs-on: windows-latest
6563
defaults:
6664
run:
6765
shell: msys2 {0}
66+
6867
steps:
69-
- uses: actions/checkout@v4
68+
- uses: actions/checkout@v6
69+
7070
- uses: msys2/setup-msys2@v2
7171
with:
72-
msystem: MINGW64
72+
msystem: mingw64
7373
update: true
74-
install: git
75-
make
76-
mingw-w64-x86_64-toolchain
77-
mingw-w64-x86_64-libvips
78-
mingw-w64-x86_64-openslide
79-
mingw-w64-x86_64-libheif
80-
mingw-w64-x86_64-libjxl
81-
mingw-w64-x86_64-imagemagick
82-
mingw-w64-x86_64-poppler
83-
mingw-w64-x86_64-lua-luarocks
84-
mingw-w64-x86_64-${{ matrix.lua.name }}
85-
86-
- name: Lua dependencies
74+
install: >-
75+
git
76+
make
77+
mingw-w64-x86_64-toolchain
78+
mingw-w64-x86_64-libvips
79+
mingw-w64-x86_64-openslide
80+
mingw-w64-x86_64-libheif
81+
mingw-w64-x86_64-libjxl
82+
mingw-w64-x86_64-imagemagick
83+
mingw-w64-x86_64-poppler
84+
mingw-w64-x86_64-lua-luarocks
85+
mingw-w64-x86_64-${{ matrix.lua.msys2-name }}
86+
87+
- name: Prepare LuaRocks config for Lua 5.3
88+
if: matrix.lua.exe == 'lua5.3'
89+
run: cp /mingw64/etc/luarocks/config-5.{4,3}.lua
90+
91+
- name: Prepare LuaRocks
8792
run: |
88-
if [[ ${{ matrix.lua.exe }} == lua5.3 ]]; then
89-
cp /mingw64/etc/luarocks/config-5.{4,3}.lua
90-
fi
9193
luarocks config --scope system lua_version ${{ matrix.lua.version }}
9294
luarocks config --scope system lua_interpreter ${{ matrix.lua.exe }}.exe
93-
luarocks config --scope system variables.LUA_DIR /mingw64/bin
94-
luarocks config --scope system variables.LUA_INCDIR ${{ matrix.lua.incdir }}
95-
if [[ ${{ matrix.lua.exe }} == luajit ]]; then
96-
luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
97-
fi
95+
luarocks config --scope system lua_dir /mingw64
9896
99-
- name: Add to PATH
100-
run: |
101-
echo $RUNNER_TEMP/msys64/mingw64/bin:$HOME/.luarocks/bin >> $GITHUB_PATH
97+
- name: Prepare LuaJIT environment
98+
if: matrix.lua.exe == 'luajit'
99+
run: luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
100+
101+
- name: Add local LuaRocks bin to PATH
102+
run: echo "$HOME/.luarocks/bin" >> $GITHUB_PATH
102103

103104
- name: Install lua-vips
104-
run: |
105-
luarocks make
105+
run: luarocks make
106106

107107
- name: Lint with luacheck
108108
run: |
109109
luarocks install luacheck
110110
luacheck.bat -q .
111111
112112
- name: Busted tests
113-
run: |
114-
luarocks test spec -- --lua=${{ matrix.lua.exe }} -o gtest -v
113+
run: luarocks test spec -- --lua=${{ matrix.lua.exe }} -o gtest -v

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,7 @@ Installing `lua-vips` on Windows is a bit harder than on Unix systems. We recomm
714714
pacman -S mingw-w64-x86_64-luajit
715715
luarocks config --scope system lua_version 5.1
716716
luarocks config --scope system lua_interpreter luajit.exe
717-
luarocks config --scope system variables.LUA_DIR /mingw64/bin
718-
luarocks config --scope system variables.LUA_INCDIR /mingw64/include/luajit-2.1/
717+
luarocks config --scope system lua_dir /mingw64
719718
luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
720719
```
721720
7. Install `lua-vips` via

0 commit comments

Comments
 (0)