Skip to content

Improve CI and LuaRocks manual publishing workflows #4

Improve CI and LuaRocks manual publishing workflows

Improve CI and LuaRocks manual publishing workflows #4

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
branches:
- master
paths:
- "src/**"
- "spec/**"
- "examples/**"
- "LuaSF.lua"
- "LuaStat.lua"
- "*.rockspec"
- ".github/workflows/ci.yml"
permissions:
contents: read
jobs:
test:
name: Lua ${{ matrix.lua-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lua-version:
- "5.1.5"
- "5.2.4"
- "5.3.6"
- "5.4.8"
- "luajit-2.1"
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Lua
uses: leafo/gh-actions-lua@v13
with:
luaVersion: ${{ matrix.lua-version }}
- name: Set up LuaRocks
uses: leafo/gh-actions-luarocks@v6
- name: Install test dependencies
run: luarocks install luaunit
- name: Configure local Lua module path
run: echo "LUA_PATH=./src/?.lua;./?.lua;${LUA_PATH}" >> "$GITHUB_ENV"
- name: Run tests
run: |
lua spec/test_stats.lua
lua spec/test_distributions.lua
lua spec/test_sampling.lua
- name: Run examples
run: |
lua examples/dice_simulation.lua
lua examples/normal_quality_control.lua
lua examples/gamma_distribution.lua
lua examples/weighted_loot_drop.lua
lua examples/monte_carlo_pi.lua
lua examples/poisson_arrivals.lua
lua examples/binomial_coin_flips.lua
lua examples/bootstrap_mean.lua