Skip to content

Commit d2f30cd

Browse files
committed
Use Github actions for installing Lua/Luarocks, check all Lua versions
1 parent f370978 commit d2f30cd

File tree

3 files changed

+27
-98
lines changed

3 files changed

+27
-98
lines changed

.ci/install-luarocks.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/ci.yml

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

3-
on: [ push, pull_request ]
3+
on: [push, pull_request]
44

55
jobs:
6-
CI-Linux-LuaJIT:
7-
name: "Linux x64 with LuaJIT"
8-
runs-on: ubuntu-22.04
6+
test:
7+
runs-on: ubuntu-latest
98

10-
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v4
13-
14-
- name: Install dependencies
15-
run: |
16-
# Use the official APT repositories from OpenResty to install LuaJIT
17-
curl -sSL "https://openresty.org/package/pubkey.gpg" | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
18-
echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] https://openresty.org/package/ubuntu $(lsb_release -sc) main" | \
19-
sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null
20-
# Install dependencies
21-
sudo apt-get update
22-
sudo apt-get install --no-install-recommends openresty libvips-dev
23-
24-
- name: Install LuaRocks
25-
env:
26-
LUAROCKS_VERSION: 3.9.2
27-
run:
28-
.ci/install-luarocks.sh
29-
--with-lua=/usr/local/openresty/luajit/
30-
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
31-
32-
- name: Prepare environment
33-
run: |
34-
echo "/usr/local/openresty/luajit/bin:$HOME/luarocks/bin" >> $GITHUB_PATH
35-
36-
- name: Install Lua modules
37-
run: make dev
38-
39-
- name: Lint with luacheck
40-
run: make lint
41-
42-
- name: Test with busted
43-
run: make test
44-
45-
CI-Linux-Lua-54:
46-
name: "Linux x64 with Lua 5.4"
47-
runs-on: ubuntu-22.04
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
luaVersion: ["5.3", "5.4", "luajit-2.1.0-beta3", "luajit-openresty"]
4813

4914
steps:
50-
- name: Checkout code
51-
uses: actions/checkout@v4
52-
53-
- name: Install dependencies
54-
run: |
55-
sudo apt install lua5.4 liblua5.4-dev libvips-dev
15+
- uses: actions/checkout@v4
5616

57-
- name: Install LuaRocks
58-
env:
59-
LUAROCKS_VERSION: 3.9.2
60-
run:
61-
.ci/install-luarocks.sh
62-
--with-lua=/usr/
63-
--with-lua-include=/usr/include/lua5.4
17+
- uses: leafo/gh-actions-lua@v9
18+
with:
19+
luaVersion: ${{ matrix.luaVersion }}
6420

65-
- name: Prepare environment
66-
run: |
67-
echo "/usr/bin:$HOME/luarocks/bin" >> $GITHUB_PATH
21+
- uses: leafo/gh-actions-luarocks@v4
6822

69-
- name: Install Lua modules
70-
run: make dev
23+
- name: Install libvips
24+
run: |
25+
sudo apt install --no-install-recommends libvips-dev
7126
72-
- name: Install ffi
73-
run: make ffi
27+
- name: Lua dependencies
28+
run: |
29+
make dev
30+
if [[ ${{ matrix.luaVersion }} == 5.* ]]; then make ffi; fi
7431
75-
- name: Lint with luacheck
76-
run: make lint
32+
- name: Lint with luacheck
33+
run: |
34+
make lint
7735
78-
- name: Test with busted
79-
run: make test
36+
- name: Busted tests
37+
run: |
38+
make test

.luacheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
files["spec/**/*.lua"] = {
22
std = "+busted",
33
}
4+
exclude_files = { ".install", ".luarocks", ".lua" }

0 commit comments

Comments
 (0)