Files
ardupilot/.github/workflows/test_scripting.yml
T
Pierre Kancir 795f76b1b6 .github: run the workflows that use problem matchers when those change
test_sitl_copter, test_sitl_rover and test_sitl_sub register four
matchers from .github/problem-matchers/ but ignored all of .github/
bar actions and their own file, so a matcher edit never reached the
workflow it was written for.  They gain the negation esp32_build.yml
already carries.  test_scripting.yml filters on an allowlist instead,
so Lua.json has to be named there.
2026-09-08 19:44:09 +10:00

107 lines
3.2 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
./Tools/scripts/run_luacheck.sh
- 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