DEV Community

Munif Tanjim
Munif Tanjim

Posted on

Setup Lua/LuaJIT/LuaRocks in GitHub Actions workflow without any hassle πŸŒ›

My Workflow

Recently I've been dabbling with Lua, mostly tinkering with my Neovim configuration and building some plugins for it. But I've been thinking about doing some other projects using Lua too. So I built this tool called Luver for removing the some obstacles I faced going that way.

And it occured to me that it would be a pretty handly tool to use with GitHub Actions workflow.

GitHub Action: Setup Lua with Luver

How would it help you?

  • 🌜 You can easily install specific versions of Lua/LuaJIT/LuaRocks for your CI workflow.

  • πŸš€ You have install multiple versions of Lua side-by-side and switch between them in your CI workflow. So you can run tests for your Lua library against multiple version of Lua!

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

GitHub logo MunifTanjim / luver-action

πŸŒ› Set up your GitHub Actions workflow with specific versions of Lua, LuaJIT, LuaRocks using Luver ❀️

Luver GitHub Action

πŸŒ› Set up your GitHub Actions workflow with specific versions of Lua, LuaJIT, LuaRocks using Luver ❀️

Usage

See action.yml

Basic:

steps:
  - uses: actions/checkout@v2
  - uses: MunifTanjim/luver-action@v1
  - run: |
      luver install lua 5.4.3
      luver use 5.4.3
      luver install luarocks 3.8.0
  - run: |
      luarocks install luacheck
Enter fullscreen mode Exit fullscreen mode

Pre-install versions:

steps:
  - uses: actions/checkout@v2
  - uses: MunifTanjim/luver-action@v1
    with:
      lua_versions: 5.1.5 5.4.3
      luajit_versions: 5.1.5:2.1.0-beta3
      luarocks_versions: 5.1.5:3.7.0 5.4.3:3.8.0
  - run: |
      luver use 5.1.5
      lua -v
      luajit -v
      luarocks --version
Enter fullscreen mode Exit fullscreen mode

Set default lua version:

steps:
  - uses: actions/checkout@v2
  - uses: MunifTanjim/luver-action@v1
    with:
      default: 5.1.5
      lua_versions: 5.1.5 5.4.3
  - run: |
      lua -v
Enter fullscreen mode Exit fullscreen mode

License

Licensed under the MIT License. Check the LICENSE file for details.




Additional Resources / Info

If you work on Lua projects often, you can also use Luver on your development machine, it is comparable to nvm, pyenv, rbenv etc. If you think a tool like that would help you, check out: MunifTanjim/luver

Top comments (0)