-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: initial CI configuration + added tools for quality standards
- Loading branch information
1 parent
5b6b724
commit e16af8d
Showing
14 changed files
with
285 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Linting, Style, And Error Checking | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
lint: | ||
name: Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare | ||
run: | | ||
brew update | ||
brew install luacheck | ||
- name: Lint | ||
run: make lint | ||
|
||
format-check: | ||
name: Format Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare | ||
run: | | ||
brew update | ||
brew install stylua | ||
- name: Check | ||
run: make format-check | ||
|
||
lsp-check: | ||
name: LSP Error Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare | ||
run: | | ||
brew update | ||
brew install lua-language-server | ||
- name: Check | ||
run: make lsp-check | ||
|
||
help-check: | ||
name: Help Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare | ||
run: cargo install lemmy-help --features=cli | ||
|
||
- name: Check | ||
run: make help-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit Tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
nvim-version: ["stable", "nightly"] | ||
os: ["ubuntu-latest"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Neovim | ||
uses: rhysd/action-setup-vim@v1 | ||
with: | ||
neovim: true | ||
version: ${{ matrix.nvim-version }} | ||
|
||
- name: Run tests | ||
run: | | ||
nvim --version | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"diagnostics.globals": ["vim", "require", "describe", "it", "P"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,43 @@ | ||
all: lint format-check lsp-check help-check test | ||
|
||
# Checks warnings and errors in code using linter | ||
lint: | ||
luacheck lua | ||
|
||
gendocs: | ||
lemmy-help \ | ||
--layout compact:0 \ | ||
--indent 2 \ | ||
-f -t -a -c \ | ||
./lua/xcodebuild/init.lua \ | ||
./lua/xcodebuild/docs/features.lua \ | ||
./lua/xcodebuild/docs/requirements.lua \ | ||
./lua/xcodebuild/docs/highlights.lua \ | ||
./lua/xcodebuild/docs/keybindings.lua \ | ||
./lua/xcodebuild/docs/commands.lua \ | ||
./lua/xcodebuild/docs/global_variables.lua \ | ||
./lua/xcodebuild/actions.lua \ | ||
./lua/xcodebuild/core/constants.lua \ | ||
./lua/xcodebuild/core/autocmd.lua \ | ||
./lua/xcodebuild/core/config.lua \ | ||
./lua/xcodebuild/core/quickfix.lua \ | ||
./lua/xcodebuild/core/xcode.lua \ | ||
./lua/xcodebuild/xcode_logs/parser.lua \ | ||
./lua/xcodebuild/xcode_logs/panel.lua \ | ||
./lua/xcodebuild/project/config.lua \ | ||
./lua/xcodebuild/project/appdata.lua \ | ||
./lua/xcodebuild/project/builder.lua \ | ||
./lua/xcodebuild/project/manager.lua \ | ||
./lua/xcodebuild/platform/device.lua \ | ||
./lua/xcodebuild/platform/device_proxy.lua \ | ||
./lua/xcodebuild/broadcasting/events.lua \ | ||
./lua/xcodebuild/broadcasting/notifications.lua \ | ||
./lua/xcodebuild/tests/diagnostics.lua \ | ||
./lua/xcodebuild/tests/enumeration_parser.lua \ | ||
./lua/xcodebuild/tests/explorer.lua \ | ||
./lua/xcodebuild/tests/provider.lua \ | ||
./lua/xcodebuild/tests/runner.lua \ | ||
./lua/xcodebuild/tests/search.lua \ | ||
./lua/xcodebuild/tests/snapshots.lua \ | ||
./lua/xcodebuild/code_coverage/coverage.lua \ | ||
./lua/xcodebuild/code_coverage/report.lua \ | ||
./lua/xcodebuild/integrations/dap.lua \ | ||
./lua/xcodebuild/integrations/remote_debugger.lua \ | ||
./lua/xcodebuild/integrations/lsp.lua \ | ||
./lua/xcodebuild/integrations/nvim-tree.lua \ | ||
./lua/xcodebuild/ui/pickers.lua \ | ||
./lua/xcodebuild/helpers.lua \ | ||
./lua/xcodebuild/util.lua \ | ||
> doc/xcodebuild.txt | ||
luacheck -q lua | ||
|
||
# Formats code | ||
format: | ||
stylua lua | ||
|
||
# Checks if code is formatted | ||
format-check: | ||
stylua --check lua | ||
|
||
# Checks errors in code using LSP | ||
lsp-check: | ||
scripts/luals-check.sh | ||
|
||
# Check if help is up-to-date | ||
help-check: | ||
scripts/update-help.sh | ||
git diff --exit-code doc/xcodebuild.txt | ||
|
||
# Updates help file | ||
help-update: | ||
scripts/update-help.sh | ||
git add doc/xcodebuild.txt | ||
|
||
# Runs tests | ||
test: | ||
nvim --headless --noplugin -u scripts/minimal_init.lua -c "PlenaryBustedDirectory specs/ { minimal_init = './scripts/minimal_init.lua' }" | ||
|
||
# Installs dependencies for plugin usage | ||
install: | ||
brew update --quiet | ||
brew install --quiet xcbeautify xcode-build-server | ||
python3 -m pip install -U pymobiledevice3 --quiet | ||
gem install --quiet xcodeproj | ||
|
||
# Installs dependencies for development | ||
install-dev: install | ||
brew install --quiet luacheck lua-language-server stylua | ||
cargo install lemmy-help --features=cli --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
|
||
# Performs a lua-language-server check on all files. | ||
# luals-out/check.json will be produced on any issues, returning 1. | ||
# Outputs only check.json to stdout, all other messages to stderr, to allow jq etc. | ||
|
||
DIR_SRC="lua" | ||
DIR_OUT="scripts/luals-out" | ||
|
||
# clear output | ||
rm -rf "${DIR_OUT}" | ||
mkdir "${DIR_OUT}" | ||
|
||
# execute inside lua to prevent luals itself from being checked | ||
OUT=$(lua-language-server --check="${DIR_SRC}" --configpath="${PWD}/.luarc.json" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error) | ||
RC=$? | ||
|
||
echo "${OUT}" >&2 | ||
|
||
if [ $RC -ne 0 ]; then | ||
echo "failed with RC=$RC" | ||
exit $RC | ||
fi | ||
|
||
# any output is a fail | ||
case "${OUT}" in | ||
*Diagnosis\ complete*) | ||
if [ -f "${DIR_OUT}/check.json" ]; then | ||
cat "${DIR_OUT}/check.json" | ||
exit 1 | ||
else | ||
exit 0 | ||
fi | ||
;; | ||
*) | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
local M = {} | ||
|
||
---@param root string|nil | ||
---@return string | ||
function M.root(root) | ||
local f = debug.getinfo(1, "S").source:sub(2) | ||
return vim.fn.fnamemodify(f, ":p:h:h") .. "/" .. (root or "") | ||
end | ||
|
||
---@param plugin string | ||
function M.install(plugin) | ||
local name = plugin:match(".*/(.*)") | ||
local package_root = M.root(".tests/site/pack/deps/start/") | ||
if not vim.loop.fs_stat(package_root .. name) then | ||
print("Installing " .. plugin) | ||
vim.fn.mkdir(package_root, "p") | ||
vim.fn.system({ | ||
"git", | ||
"clone", | ||
"--depth=1", | ||
"https://github.com/" .. plugin .. ".git", | ||
package_root .. "/" .. name, | ||
}) | ||
end | ||
end | ||
|
||
function M.setup() | ||
vim.cmd([[set runtimepath=$VIMRUNTIME]]) | ||
vim.opt.runtimepath:append(M.root()) | ||
vim.opt.packpath = { M.root(".tests/site") } | ||
vim.env.XDG_CONFIG_HOME = M.root(".tests/config") | ||
vim.env.XDG_DATA_HOME = M.root(".tests/data") | ||
vim.env.XDG_STATE_HOME = M.root(".tests/state") | ||
vim.env.XDG_CACHE_HOME = M.root(".tests/cache") | ||
|
||
M.install("nvim-lua/plenary.nvim") | ||
vim.cmd([[packadd plenary.nvim]]) | ||
end | ||
|
||
M.setup() |
Oops, something went wrong.