chore(main): release 0.3.0 #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'lua/**' | |
| - 'tests/**' | |
| - '.busted' | |
| - '.github/workflows/test.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'lua/**' | |
| - 'tests/**' | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Run Tests (${{ matrix.os }}, ${{ matrix.lua-version }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| lua-version: ["5.1", "5.2", "5.3", "5.4", "5.5", "luajit"] | |
| os: ["ubuntu-latest"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup MSVC Developer Command Prompt | |
| if: ${{ runner.os == 'Windows' && matrix['lua-version'] != 'luajit' }} | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install Lua | |
| uses: luarocks/gh-actions-lua@master | |
| with: | |
| luaVersion: ${{ matrix.lua-version }} | |
| - name: Install LuaRocks | |
| uses: luarocks/gh-actions-luarocks@master | |
| - name: Run custom setup commands | |
| shell: bash | |
| run: | | |
| SETUP_COMMANDS=$(jq -r '.["setup-commands"] // [] | join("\n")' .github/config.json) | |
| if [ -n "$SETUP_COMMANDS" ]; then | |
| bash -c "$SETUP_COMMANDS" | |
| fi | |
| - name: Resolve Rockspec | |
| shell: bash | |
| run: | | |
| PACKAGE_NAME=$(jq -r '.package' .github/config.json) | |
| ROCKSPEC="${PACKAGE_NAME}-scm-1.rockspec" | |
| if [ ! -f "$ROCKSPEC" ]; then | |
| echo "No rockspec file found: $ROCKSPEC" >&2 | |
| exit 1 | |
| fi | |
| echo "rockspec=$ROCKSPEC" >> "$GITHUB_ENV" | |
| - name: Install package (POSIX) | |
| if: ${{ runner.os != 'Windows' }} | |
| shell: bash | |
| run: luarocks install "$rockspec" | |
| - name: Install package (Windows) | |
| if: ${{ runner.os == 'Windows' }} | |
| shell: pwsh | |
| run: luarocks install $env:rockspec | |
| - name: Run Tests | |
| if: hashFiles('**/*.test.lua') != '' | |
| run: | | |
| luarocks install busted | |
| busted |