Skip to content

Commit

Permalink
Use Github actions for installing Lua/Luarocks, check all Lua versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandlo committed Mar 18, 2024
1 parent f370978 commit 9757797
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 98 deletions.
31 changes: 0 additions & 31 deletions .ci/install-luarocks.sh

This file was deleted.

93 changes: 26 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,38 @@
name: CI
name: "Unix build"

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
CI-Linux-LuaJIT:
name: "Linux x64 with LuaJIT"
runs-on: ubuntu-22.04
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
# Use the official APT repositories from OpenResty to install LuaJIT
curl -sSL "https://openresty.org/package/pubkey.gpg" | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] https://openresty.org/package/ubuntu $(lsb_release -sc) main" | \
sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null
# Install dependencies
sudo apt-get update
sudo apt-get install --no-install-recommends openresty libvips-dev
- name: Install LuaRocks
env:
LUAROCKS_VERSION: 3.9.2
run:
.ci/install-luarocks.sh
--with-lua=/usr/local/openresty/luajit/
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1

- name: Prepare environment
run: |
echo "/usr/local/openresty/luajit/bin:$HOME/luarocks/bin" >> $GITHUB_PATH
- name: Install Lua modules
run: make dev

- name: Lint with luacheck
run: make lint

- name: Test with busted
run: make test

CI-Linux-Lua-54:
name: "Linux x64 with Lua 5.4"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
luaVersion: ["5.1", "5.2", "5.3", "5.4", "luajit-2.1.0-beta3", "luajit-openresty"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt install lua5.4 liblua5.4-dev libvips-dev
- uses: actions/checkout@v4

- name: Install LuaRocks
env:
LUAROCKS_VERSION: 3.9.2
run:
.ci/install-luarocks.sh
--with-lua=/usr/
--with-lua-include=/usr/include/lua5.4
- uses: leafo/gh-actions-lua@v9
with:
luaVersion: ${{ matrix.luaVersion }}

- name: Prepare environment
run: |
echo "/usr/bin:$HOME/luarocks/bin" >> $GITHUB_PATH
- uses: leafo/gh-actions-luarocks@v4

- name: Install Lua modules
run: make dev
- name: Lua dependencies
run: |
luarocks install busted
luarocks install luacheck
if [[ ${{ matrix.luaVersion }} == 5.* ]]; then luarocks install luaffi-tkl; fi
- name: Install ffi
run: make ffi
- name: Install libvips
run: |
sudo apt install --no-install-recommends libvips-dev
- name: Lint with luacheck
run: make lint
- name: Busted tests
run: |
busted .
- name: Test with busted
run: make test
- name: Linting tests
luacheck .

0 comments on commit 9757797

Please sign in to comment.