Files
ardupilot/.github/workflows/test_scripting.yml
T
James HarveyandClaude Opus 5 20fe331ef4 .github: do not run CI on tag pushes
The release procedure pushes about twenty tags at a single commit: the
per-vehicle -stable and -beta tags and the numbered ones such as
Copter-4.7.1.  Only pre-commit.yml's push trigger carries a branch
filter, so every other workflow runs for each of those tag pushes, and
path filters are not evaluated for tag pushes, so the paths-ignore
lists do not thin them out.  The 4.7.1 release produced 438 push-event
runs for one commit; 18 came from the ArduPilot-4.7 branch push and
the other 420 from the tags, each re-running the same jobs on the same
commit.  4.7.0 produced 437, and the pattern goes back to at least
4.6.2.

Filter push triggers to branches.  '**' matches every branch, so branch
pushes behave exactly as before; tag pushes stop triggering workflows.
The tags still show the commit's checks, since check results attach to
the commit; those are the release-branch push's runs, trimmed by the
usual path filters as on any other branch.

test_scripts.yml used the list form of 'on', which cannot carry a
filter, so it is expanded to the mapping form.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 09:09:22 +10:00

105 lines
3.1 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'
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'
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