Skip to content

Fixes for broken master, trust-based source selection, module split, feed discovery & caching, sectioned config, and release tooling #26

Fixes for broken master, trust-based source selection, module split, feed discovery & caching, sectioned config, and release tooling

Fixes for broken master, trust-based source selection, module split, feed discovery & caching, sectioned config, and release tooling #26

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- 'main'
workflow_dispatch:
inputs:
ref:
description: 'Release tag or branch to scan.'
required: true
default: 'main'
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
# Pin bash so the run: steps (luarocks installs, $RUNNER_TEMP paths) behave the same on every
# platform. Git Bash ships on the Windows runner.
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.ref }}
- uses: leafo/gh-actions-lua@v13
with:
luaVersion: "luajit-2.1"
# DepCtrl relies on Lua 5.2 features (table.unpack, __pairs/__len)
luaCompileFlags: "XCFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT"
# Installs a prebuilt luarocks on Windows and builds C rocks with mingw to match the
# mingw-built LuaJIT. Keep MSVC off PATH (no msvc-dev-cmd) so it stays in mingw mode.
- uses: luarocks/gh-actions-luarocks@v7
# moonscript loader
- run: luarocks --lua-version=5.1 install moonscript
# lfs (Aegisub provides an internal copy)
- run: luarocks --lua-version=5.1 install luafilesystem
# CLI argument parsing
- run: luarocks --lua-version=5.1 install argparse
# mock HTTP server dependencies
- run: luarocks --lua-version=5.1 install luasocket
- run: luarocks --lua-version=5.1 install copas
- run: luarocks --lua-version=5.1 install pegasus
# json schema validation
- run: luarocks --lua-version=5.1 install lua-schema
- run: luarocks --lua-version=5.1 install lpeg
- name: Run tests
timeout-minutes: 5
run: lua depctrl.lua test
- name: Publish test report
uses: ctrf-io/github-test-reporter@v1
if: ${{ !cancelled() }}
with:
report-path: ./ctrf/*.json
pull-request: ${{ github.event_name == 'pull_request' && true || false }}
overwrite-comment: ${{ github.event_name == 'pull_request' && true || false }}
# Per-platform keys keep the three matrix legs from colliding on one shared PR comment,
# status check, and artifact.
comment-tag: ${{ matrix.os }}
status-check-name: Test results (${{ matrix.os }})
artifact-name: ctrf-report-${{ matrix.os }}
annotate: false
use-suite-name: true
status-check: true
summary-report: true
failed-report: true
upload-artifact: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Lint the module sources' LuaCATS annotations: missing docs on public members and
# @param/@return that disagree with the real signature fail the build. This also emits every
# definition and verifies it is loadable Lua, so it doubles as type-generation coverage.
- name: Check annotations
if: ${{ !cancelled() }}
run: lua depctrl.lua generate-types --check
# Smoke-test that documentation generation runs over the real feed without a parse or emit
# failure. --site none skips scaffolding; the output goes to a throwaway directory.
- name: Smoke-test doc generation
if: ${{ !cancelled() }}
run: lua depctrl.lua generate-docs --site none -o "$RUNNER_TEMP/docs"