Note: Requires version 8 or higher due to GitHub Actions core library updates.
Compiles and configures Lua runtime in the .lua/ directory within your workspace.
Automatically adds .lua/bin to the system PATH for direct lua command access.
Basic Lua installation: (Defaults to latest stable release, currently 5.4.7)
- uses: step-security/gh-actions-lua@v12Specify Lua version:
- uses: step-security/gh-actions-lua@v12
with:
luaVersion: "5.1.5"Install LuaJIT variant:
- uses: step-security/gh-actions-lua@v12
with:
luaVersion: "luajit-2.1.0-beta3"For Windows environments, include the MSVC development tools setup:
ilammy/msvc-dev-cmd@v1. This is safe to include on all platforms.
- uses: ilammy/msvc-dev-cmd@v1
- uses: step-security/gh-actions-lua@v12Default: "5.4"
Determines which Lua version to build and install.
Supported versions:
"5.1.5""5.2.4""5.3.6""5.4.7""luajit-2.0""luajit-2.1""luajit-master""luajit-openresty"
Source locations:
luajit-openresty— Downloads from https://github.com/openresty/luajit2 (master branch)luajit-*variants — Downloads from https://github.com/luajit/luajit (respective branches)- Standard versions — Downloads from https://www.lua.org/ftp/
Quick aliases
Use shorthand versions: 5.1, 5.2, 5.3, 5.4, luajit to get the latest patch version.
Default: ""
Custom compilation options passed to the build system.
Usage example:
- uses: step-security/gh-actions-lua@v12
with:
luaVersion: 5.3
luaCompileFlags: LUA_CFLAGS="-DLUA_INT_TYPE=LUA_INT_INT"Compilation flags may behave differently between Lua and LuaJIT builds.
Testing a Lua project with LuaRocks dependencies and busted test framework.
Create .github/workflows/test.yml:
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: step-security/gh-actions-lua@v12
with:
luaVersion: "5.1.5"
- uses: leafo/gh-actions-luarocks@v4
- name: build
run: |
luarocks install busted
luarocks make
- name: test
run: |
busted -o utfTerminalThis workflow:
- Installs Lua 5.1.5 — Change
luaVersionfor different versions or useluajit-*for LuaJIT - Uses
.rockspecfrom repository root for dependency management vialuarocks make
Test across multiple Lua versions using matrix builds:
jobs:
test:
strategy:
matrix:
luaVersion: ["5.1.5", "5.2.4", "luajit-2.1.0-beta3"]
steps:
- uses: actions/checkout@v5
- uses: step-security/gh-actions-lua@v12
with:
luaVersion: ${{ matrix.luaVersion }}
# additional steps...