Skip to content

docs: update the documentation to match current functionality #18

docs: update the documentation to match current functionality

docs: update the documentation to match current functionality #18

Workflow file for this run

name: Test 🧪
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
name: Test and check ️✅
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- lua-type: "lua"
lua-version: "5.1"
- lua-type: "lua"
lua-version: "5.2"
- lua-type: "lua"
lua-version: "5.3"
- lua-type: "lua"
lua-version: "5.4"
- lua-type: "luajit"
luajit-version: "2.0"
- lua-type: "luajit"
luajit-version: "2.1"
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
- name: Install hererocks
run: pip install hererocks
- name: Setup Lua
run: |
mkdir -p lua_install
if [[ "${{ matrix.lua-type }}" == "lua" ]]; then
hererocks lua_install -r^ --lua=${{ matrix.lua-version }}
else
hererocks lua_install -r^ --luajit=${{ matrix.luajit-version }}
fi
echo "$PWD/lua_install/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
luarocks install luacheck
luarocks install busted
luarocks install luacov
- name: Run tests and checks
run: |
luacheck --no-unused-args --std max+busted smiti18n spec
busted --verbose --coverage
- name: Generate and show coverage report
run: |
luacov
{
if [[ "${{ matrix.lua-type }}" == "lua" ]]; then
echo "# Test Coverage Summary - Lua ${{ matrix.lua-version }}"
else
echo "# Test Coverage Summary - LuaJIT ${{ matrix.luajit-version }}"
fi
echo ""
echo "| File | Hits | Missed | Coverage |"
echo "|------|------|---------|----------|"
grep "^smiti18n/.*[0-9]" luacov.report.out | sort -u | sed -E 's/^([^|]+[^ ])[[:space:]]+([0-9]+)[[:space:]]+([0-9]+)[[:space:]]+([0-9.]+)%[[:space:]]*$/| \1 | \2 | \3 | \4% |/'
} >> $GITHUB_STEP_SUMMARY