Files
ardupilot/.github/workflows/test_scripting.yml
Andrew Tridgell 286d36cb57 ci: execute MAVLink Lua layout regression tests
Linting alone does not check the binary layout decoder assertions. Run the fixture with Lua 5.4 so header offsets, legacy layouts and target handling are checked by the scripting workflow.
2026-09-27 09:33:19 +10:00

110 lines
3.3 KiB
YAML

name: test scripting
on:
push:
branches: ['**'] # excludes tag pushes
paths: # only run for scripting changes
- 'libraries/AP_Scripting/tests/docs_check.py'
- 'libraries/AP_Scripting/generator/**'
- '**.lua'
- 'Tools/scripts/run_lua_language_check.py'
- 'Tools/scripts/run_luacheck.sh'
- 'Tools/scripts/generate_lua_docs.sh'
- '.github/workflows/test_scripting.yml'
- '.github/problem-matchers/Lua.json'
pull_request:
paths: # only run for scripting changes
- 'libraries/AP_Scripting/tests/docs_check.py'
- 'libraries/AP_Scripting/generator/**'
- '**.lua'
- 'Tools/scripts/run_lua_language_check.py'
- 'Tools/scripts/run_luacheck.sh'
- 'Tools/scripts/generate_lua_docs.sh'
- '.github/workflows/test_scripting.yml'
- '.github/problem-matchers/Lua.json'
workflow_dispatch:
concurrency:
group: ci-${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test-scripting:
runs-on: ubuntu-slim
steps:
# git checkout the PR
- uses: actions/checkout@v7
with:
submodules: false
persist-credentials: false
- name: Checkout waf submodule
run: git submodule update --init --recursive --depth 1 modules/waf
- name: Install pip dependencies
run: |
python3 -m pip install github-release-downloader empy==3.3.4
- name: Register lua check problem matcher
run: |
echo "::add-matcher::.github/problem-matchers/Lua.json"
echo "::remove-matcher owner=Lua-language-server-problem-matcher::"
- name: Lua Linter
shell: bash
run: |
sudo apt-get update
sudo apt-get -y install lua-check lua5.4
./Tools/scripts/run_luacheck.sh
- name: MAVLink layout regression test
run: lua5.4 libraries/AP_Scripting/tests/mavlink_layout.lua
- name: Register lua language server problem matcher
run: |
echo "::add-matcher::.github/problem-matchers/Lua.json"
echo "::remove-matcher owner=Luacheck-problem-matcher::"
- name: Language server check
shell: bash
run: |
python3 ./Tools/scripts/run_lua_language_check.py --debugLogging
- name: Remove problem matchers
run: |
echo "::remove-matcher owner=Luacheck-problem-matcher::"
echo "::remove-matcher owner=Lua-language-server-problem-matcher::"
- name: Generate lua markdown API docs
shell: bash
run: |
./Tools/scripts/generate_lua_docs.sh
- name: Copy current lua docs
run: |
PATH="/github/home/.local/bin:$PATH"
mv "libraries/AP_Scripting/docs/docs.lua" "libraries/AP_Scripting/docs/current_docs.lua"
- name: ReGenerate lua docs and annotations from code
shell: bash
run: |
./waf configure
./waf scripting_docs
- name: Compare Previous and current lua docs
run: |
PATH="/github/home/.local/bin:$PATH"
python ./libraries/AP_Scripting/tests/docs_check.py "./libraries/AP_Scripting/docs/docs.lua" "./libraries/AP_Scripting/docs/current_docs.lua"
- name: Upload docs
uses: actions/upload-artifact@v7
with:
name: Docs
path: ScriptingDocs.md
retention-days: 7