Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 63 additions & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,102 +13,101 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6

- uses: leafo/gh-actions-lua@v12
with:
luaVersion: ${{ matrix.luaVersion }}
- uses: leafo/gh-actions-lua@v12
with:
luaVersion: ${{ matrix.luaVersion }}

- uses: leafo/gh-actions-luarocks@v6
- uses: leafo/gh-actions-luarocks@v6

- name: Install Ubuntu dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libvips-dev
- name: Install Ubuntu dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends libvips-dev

- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install vips
echo "DYLD_LIBRARY_PATH=$(brew --prefix vips)/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install vips
echo "DYLD_LIBRARY_PATH=$(brew --prefix vips)/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV

- name: Install lua-vips
run: |
if [[ ${{ matrix.luaVersion }} == luajit* ]]; then
luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
fi
luarocks make
- name: Prepare LuaJIT environment
if: startsWith(matrix.luaVersion, 'luajit')
run: luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1

- name: Lint with luacheck
run: |
luarocks install luacheck
luacheck -q .
- name: Install lua-vips
run: luarocks make

- name: Busted tests
run: |
luarocks test spec/ -- -o gtest -v spec
- name: Lint with luacheck
run: |
luarocks install luacheck
luacheck -q .

- name: Busted tests
run: luarocks test spec/ -- -o gtest -v spec

windows:
strategy:
fail-fast: false
matrix:
lua: [
#{name: "lua51", exe: "lua5.1", version: 5.1, incdir: "/mingw64/include/lua5.1/"}, #(two tests are failing)
{name: "lua53", exe: "lua5.3", version: 5.3, incdir: "/mingw64/include/lua5.3/"},
{name: "lua", exe: "lua", version: 5.4, incdir: "/mingw64/include/"},
{name: "luajit", exe: "luajit", version: 5.1, incdir: "/mingw64/include/luajit-2.1/"}
]
include:
# Two tests are failing
#- lua: { version: "5.1", msys2-name: "lua51", exe: "lua5.1" }
- lua: { version: "5.3", msys2-name: "lua53", exe: "lua5.3" }
- lua: { version: "5.4", msys2-name: "lua", exe: "lua" }
- lua: { version: "5.1", msys2-name: "luajit", exe: "luajit" }

runs-on: windows-latest
defaults:
run:
shell: msys2 {0}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: mingw64
update: true
install: git
make
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-libvips
mingw-w64-x86_64-openslide
mingw-w64-x86_64-libheif
mingw-w64-x86_64-libjxl
mingw-w64-x86_64-imagemagick
mingw-w64-x86_64-poppler
mingw-w64-x86_64-lua-luarocks
mingw-w64-x86_64-${{ matrix.lua.name }}

- name: Lua dependencies
install: >-
git
make
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-libvips
mingw-w64-x86_64-openslide
mingw-w64-x86_64-libheif
mingw-w64-x86_64-libjxl
mingw-w64-x86_64-imagemagick
mingw-w64-x86_64-poppler
mingw-w64-x86_64-lua-luarocks
mingw-w64-x86_64-${{ matrix.lua.msys2-name }}

- name: Prepare LuaRocks config for Lua 5.3
if: matrix.lua.exe == 'lua5.3'
run: cp /mingw64/etc/luarocks/config-5.{4,3}.lua

- name: Prepare LuaRocks
run: |
if [[ ${{ matrix.lua.exe }} == lua5.3 ]]; then
cp /mingw64/etc/luarocks/config-5.{4,3}.lua
fi
luarocks config --scope system lua_version ${{ matrix.lua.version }}
luarocks config --scope system lua_interpreter ${{ matrix.lua.exe }}.exe
luarocks config --scope system variables.LUA_DIR /mingw64/bin
luarocks config --scope system variables.LUA_INCDIR ${{ matrix.lua.incdir }}
if [[ ${{ matrix.lua.exe }} == luajit ]]; then
luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
fi
luarocks config --scope system lua_dir /mingw64

- name: Add to PATH
run: |
echo $RUNNER_TEMP/msys64/mingw64/bin:$HOME/.luarocks/bin >> $GITHUB_PATH
- name: Prepare LuaJIT environment
if: matrix.lua.exe == 'luajit'
run: luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1

- name: Add local LuaRocks bin to PATH
run: echo "$HOME/.luarocks/bin" >> $GITHUB_PATH

- name: Install lua-vips
run: |
luarocks make
run: luarocks make

- name: Lint with luacheck
run: |
luarocks install luacheck
luacheck.bat -q .

- name: Busted tests
run: |
luarocks test spec -- --lua=${{ matrix.lua.exe }} -o gtest -v
run: luarocks test spec -- --lua=${{ matrix.lua.exe }} -o gtest -v
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ Installing `lua-vips` on Windows is a bit harder than on Unix systems. We recomm
pacman -S mingw-w64-x86_64-luajit
luarocks config --scope system lua_version 5.1
luarocks config --scope system lua_interpreter luajit.exe
luarocks config --scope system variables.LUA_DIR /mingw64/bin
luarocks config --scope system variables.LUA_INCDIR /mingw64/include/luajit-2.1/
luarocks config --scope system lua_dir /mingw64
luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
```
7. Install `lua-vips` via
Expand Down
Loading