Skip to content

Commit

Permalink
Test everything!
Browse files Browse the repository at this point in the history
  • Loading branch information
danhunsaker committed Apr 12, 2024
1 parent 47753d2 commit 979061a
Show file tree
Hide file tree
Showing 9 changed files with 247 additions and 26 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/gremlin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Gremlin Script Tools'

on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:

jobs:
test:
name: Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: '5.1'
- run: 'mkdir "C:\Program Files\Eagle Dynamics\DCS World"'
- run: '7z x lib\DCS_archive.zip -o"C:\Program Files\Eagle Dynamics\DCS World"'
- run: .\runtests.bat gremlin
20 changes: 10 additions & 10 deletions .github/workflows/mdbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
cargo install --version ${MDBOOK_VERSION} mdbook
- name: Setup Lua
uses: leafo/gh-actions-lua@v8
with:
luaVersion: 5.4
- name: Setup LuaRocks
uses: leafo/gh-actions-luarocks@v4
- name: Setup LDoc
run: luarocks install ldoc
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Generate API docs
run:
alias ldoc='docker run -v "$(pwd):/data" ghcr.io/lunarmodules/ldoc:latest'
cd docs/api/
ldoc -c gremlin.ldoc
ldoc -c evac.ldoc
ldoc -c ungency.ldoc
ldoc -c waves.ldoc
- name: Build with mdBook
run: mdbook build
- name: Generate and build docs
run: ./builddocs.bat
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/urgency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Gremlin Urgency'

on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:

jobs:
test:
name: Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: '5.1'
- run: 'mkdir "C:\Program Files\Eagle Dynamics\DCS World"'
- run: '7z x lib\DCS_archive.zip -o"C:\Program Files\Eagle Dynamics\DCS World"'
- run: .\runtests.bat urgency
22 changes: 22 additions & 0 deletions .github/workflows/waves.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Gremlin Waves'

on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch:

jobs:
test:
name: Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: '5.1'
- run: 'mkdir "C:\Program Files\Eagle Dynamics\DCS World"'
- run: '7z x lib\DCS_archive.zip -o"C:\Program Files\Eagle Dynamics\DCS World"'
- run: .\runtests.bat waves
9 changes: 9 additions & 0 deletions builddocs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo off

cd docs\api\ & ^
ldoc.lua.bat -c gremlin.ldoc . & ^
ldoc.lua.bat -c evac.ldoc . & ^
ldoc.lua.bat -c urgency.ldoc . & ^
ldoc.lua.bat -c waves.ldoc . & ^
cd ..\..\ & ^
mdbook build
2 changes: 1 addition & 1 deletion docs/api/ldoc.ltp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ $(ldoc.prettify(kitem.usage[1]))
> end
> end
> for item in items() do
**$(display_name(item))**
$(lev3) `$(display_name(item))`

> if ldoc.prettify_files and ldoc.is_file_prettified[item.module.file.filename] then
[line $(item.lineno)]($(ldoc.source_ref(item)))
Expand Down
8 changes: 5 additions & 3 deletions mocks/DCS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,11 @@ Unit = {
return mist.DBs.unitsByName[_name]
end

for _, _units in pairs(Evac._state.extractableNow) do
if _units[_name] ~= nil and _units[_name][0] ~= nil then
return _units[_name][0].object or _units[_name][0]
if Evac ~= nil then
for _, _units in pairs(Evac._state.extractableNow) do
if _units[_name] ~= nil and _units[_name][0] ~= nil then
return _units[_name][0].object or _units[_name][0]
end
end
end

Expand Down
Loading

0 comments on commit 979061a

Please sign in to comment.