-
Notifications
You must be signed in to change notification settings - Fork 17.8k
73 lines (61 loc) · 2.19 KB
/
test_scripting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: test scripting
on:
push:
paths: # only run for scripting changes
- 'libraries/AP_Scripting/tests/docs_check.py'
- 'libraries/AP_Scripting/generator/**'
- '**.lua'
pull_request:
paths: # only run for scripting changes
- 'libraries/AP_Scripting/tests/docs_check.py'
- 'libraries/AP_Scripting/generator/**'
- '**.lua'
workflow_dispatch:
concurrency:
group: ci-${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-scripting:
runs-on: ubuntu-22.04
container: ardupilot/ardupilot-dev-base:v0.1.3
steps:
# git checkout the PR
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Lua Linter
shell: bash
run: |
sudo apt-get update
sudo apt-get -y install lua-check
./Tools/scripts/run_luacheck.sh
- name: Language server check
shell: bash
run: |
python -m pip install github-release-downloader
python ./Tools/scripts/run_lua_language_check.py
- name: Generate docs md
shell: bash
run: |
./Tools/scripts/generate_lua_docs.sh
- name: copy docs
run: |
PATH="/github/home/.local/bin:$PATH"
mv "libraries/AP_Scripting/docs/docs.lua" "libraries/AP_Scripting/docs/current_docs.lua"
- name: build sitl # we don't really need to build the full code, just trigger docs re-gen with --scripting-docs, timeout after 10 seconds
shell: bash
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
PATH="/github/home/.local/bin:$PATH"
./waf configure --board sitl
timeout 10 ./waf antennatracker --scripting-docs || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
- name: run compare
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@v4
with:
name: Docs
path: ScriptingDocs.md
retention-days: 7