Public-readable Tier-1 exception (alongside sporel-meta) for the practical reason that community pipelines need to call into these workflows without per-repo deploy-token setup. 5 reusable workflows moved from sporel-meta/.gitea/workflows/ to here (Plan-B.1: privacy-fix for sporel-meta which stays private with the proprietary design docs). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
# Reusable workflow: Lua-Lib / Module (Cat 3 per ADR-0025)
|
|
# luacheck + JSON validation + on-tag zip
|
|
name: Lua CI
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
lint_target:
|
|
description: "Path glob to lint (default: lua/ + init.lua + scripts/)"
|
|
type: string
|
|
default: "lua/ scripts/ init.lua"
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install luacheck
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y luarocks
|
|
sudo luarocks install luacheck
|
|
|
|
- name: Run luacheck
|
|
run: |
|
|
luacheck ${{ inputs.lint_target }} --no-unused-args --no-self || \
|
|
(echo "::error::luacheck failures" && exit 1)
|
|
|
|
- name: Manifest validation
|
|
shell: bash
|
|
run: |
|
|
for manifest in manifest.module manifest.core lib.json; do
|
|
if [ -f "$manifest" ]; then
|
|
python3 -c "import json; json.load(open('$manifest'))" || \
|
|
(echo "::error::$manifest invalid JSON" && exit 1)
|
|
echo "$manifest: valid JSON"
|
|
fi
|
|
done
|
|
if [ -f dependencies.json ]; then
|
|
python3 -c "import json; d=json.load(open('dependencies.json')); assert 'required' in d or 'suggests' in d"
|
|
fi
|
|
|
|
- name: README presence (per ADR-0026)
|
|
run: |
|
|
test -s README.md || (echo "::error::README.md missing or empty" && exit 1)
|
|
|
|
- name: LICENSE presence (per ADR-0027)
|
|
run: |
|
|
test -s LICENSE || (echo "::error::LICENSE missing or empty" && exit 1)
|
|
|
|
package:
|
|
needs: lint
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Package as zip
|
|
run: |
|
|
ARTEFACT="${GITHUB_REPOSITORY##*/}-${GITHUB_REF_NAME}.zip"
|
|
zip -r "$ARTEFACT" . -x "*.git/*" -x "*.gitea/*" -x "tests/*"
|
|
echo "ARTEFACT_NAME=$ARTEFACT" >> "$GITHUB_ENV"
|
|
|
|
- name: Upload to Gitea Release
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
files: ${{ env.ARTEFACT_NAME }}
|