-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d1b6e3
commit 1985dab
Showing
14 changed files
with
277 additions
and
81 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,2 @@ | ||
[languages] | ||
lua = ["stylua -s -"] |
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,56 @@ | ||
name: Lua Language Server Check | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
lua_ls_version: | ||
required: true | ||
type: string | ||
neovim_versions: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
lua-language-server: | ||
name: lua language server | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rev: ${{ fromJson(inputs.neovim_versions) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: date +%F > todays-date | ||
- name: Restore cache for Neovim | ||
uses: actions/cache@v3 | ||
with: | ||
path: .ci/neovim | ||
key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }} | ||
- name: Restore cache for vendor dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .ci/vendor | ||
key: ${{ hashFiles('todays-date') }} | ||
- name: Restore cache for lua LS | ||
uses: actions/cache@v3 | ||
with: | ||
path: .ci/lua-ls | ||
key: ${{ inputs.lua_ls_version }} | ||
- name: Prepare | ||
run: | | ||
test -d .ci/neovim || { | ||
mkdir -p .ci/neovim | ||
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/.ci/neovim" | ||
} | ||
test -d .ci/lua-ls || { | ||
mkdir -p .ci/lua-ls | ||
curl -sL "https://github.com/LuaLS/lua-language-server/releases/download/${{ inputs.lua_ls_version }}/lua-language-server-${{ inputs.lua_ls_version }}-linux-x64.tar.gz" | tar xzf - -C "${PWD}/.ci/lua-ls" | ||
} | ||
- name: Run check | ||
run: | | ||
export PATH="${PWD}/.ci/neovim/bin:${PATH}" | ||
export PATH="${PWD}/.ci/lua-ls/bin:${PATH}" | ||
export VIM="${PWD}/.ci/neovim/share/nvim/runtime" | ||
nvim --version | ||
make lua-language-server version=${{ matrix.rev == 'nightly' && 'nightly' || 'stable' }} |
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,25 @@ | ||
name: Nightly Neovim Check | ||
# Checks LSP and unit tests against new Neovim nightly once a week | ||
|
||
on: | ||
schedule: | ||
- cron: '30 21 * * 0' # 6:30 AM JST, Monday | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/tests.yml | ||
with: | ||
neovim_versions: | | ||
[ "nightly" ] | ||
lua-language-server: | ||
uses: ./.github/workflows/lua_language_server.yml | ||
with: | ||
lua_ls_version: 3.9.1 | ||
neovim_versions: | | ||
[ "nightly" ] |
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,61 +1,81 @@ | ||
name: Pull request check | ||
name: Pull Request Check | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
tests: | ||
uses: ./.github/workflows/tests.yml | ||
with: | ||
neovim_versions: | | ||
[ "nightly", "v0.10.0" ] | ||
lua-language-server: | ||
uses: ./.github/workflows/lua_language_server.yml | ||
with: | ||
lua_ls_version: 3.9.1 | ||
neovim_versions: | | ||
[ "nightly", "v0.10.0" ] | ||
stylua: | ||
name: stylua | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: JohnnyMorganz/stylua-action@1.0.0 | ||
- uses: actions/checkout@v3 | ||
- uses: JohnnyMorganz/stylua-action@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --check . | ||
version: latest | ||
args: --color always --check . | ||
|
||
luacheck: | ||
name: luacheck | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y luarocks | ||
sudo luarocks install luacheck | ||
- name: Lint | ||
run: sudo make luacheck | ||
|
||
block-fixup: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Block Fixup Commit Merge | ||
uses: 13rac1/[email protected] | ||
|
||
luacheck: | ||
conventional-commit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- uses: leafo/[email protected] | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
luaVersion: 'luajit-2.1.0-beta3' | ||
|
||
- uses: leafo/[email protected] | ||
|
||
- name: build | ||
run: | | ||
luarocks install luacheck | ||
fetch-depth: 0 | ||
|
||
- name: test | ||
- name: Check Commit Messages | ||
run: | | ||
luacheck lua specs | ||
tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- stable | ||
- nightly | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Neovim | ||
uses: rhysd/action-setup-vim@v1 | ||
id: neovim | ||
with: | ||
neovim: true | ||
version: ${{ matrix.version }} | ||
- name: Run tests | ||
run: make specs | ||
commits=$(git log --no-merges --pretty=format:"%s" HEAD~${{ github.event.pull_request.commits }}..HEAD) | ||
bad_commits=() | ||
for commit in "$commits"; do | ||
if ! echo $commit | grep -qE "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?: .+"; then | ||
bad_commits+=("$commit") | ||
fi | ||
done | ||
if [[ ${#bad_commits[@]} -ne 0 ]]; then | ||
echo "The following commits do not follow the Conventional Commit format:" | ||
for bad_commit in "${bad_commits[@]}"; do | ||
echo " - $bad_commit" | ||
done | ||
exit 1 | ||
fi |
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 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
neovim_versions: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
tests: | ||
name: unit tests | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rev: ${{ fromJson(inputs.neovim_versions) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: date +%F > todays-date | ||
- name: Restore cache for Neovim | ||
uses: actions/cache@v3 | ||
with: | ||
path: .ci/neovim | ||
key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }} | ||
- name: Prepare | ||
run: | | ||
test -d .ci/neovim || { | ||
mkdir -p .ci/neovim | ||
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/.ci/neovim" | ||
} | ||
- name: Run tests | ||
run: | | ||
export PATH="${PWD}/.ci/neovim/bin:${PATH}" | ||
export VIM="${PWD}/.ci/neovim/share/nvim/runtime" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/doc/tags | ||
vendor | ||
.ci/* |
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,2 +1,6 @@ | ||
globals = { "vim", "_", "assert", "describe", "before_each", "after_each", "it" } | ||
globals = { "vim", "_", "describe", "it", "after_each", "before_each", "assert" } | ||
max_line_length = false | ||
|
||
exclude_files = { | ||
".ci/vendor", | ||
} |
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,18 @@ | ||
{ | ||
"runtime.version": "LuaJIT", | ||
"diagnostics.globals": [ | ||
"it", | ||
"describe", | ||
"before_each", | ||
"after_each", | ||
"setup", | ||
"teardown" | ||
], | ||
"diagnostics.ignoredFiles": "Disable", | ||
"diagnostics.libraryFiles": "Disable", | ||
"workspace.library": [ | ||
"/usr/local/share/nvim/runtime/lua", | ||
".ci/neovim/share/nvim/runtime/lua", | ||
".ci/vendor/pack/vendor/start/neodev.nvim/types/nightly" | ||
] | ||
} |
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,18 @@ | ||
{ | ||
"runtime.version": "LuaJIT", | ||
"diagnostics.globals": [ | ||
"it", | ||
"describe", | ||
"before_each", | ||
"after_each", | ||
"setup", | ||
"teardown" | ||
], | ||
"diagnostics.ignoredFiles": "Disable", | ||
"diagnostics.libraryFiles": "Disable", | ||
"workspace.library": [ | ||
"/usr/local/share/nvim/runtime/lua", | ||
".ci/neovim/share/nvim/runtime/lua", | ||
".ci/vendor/pack/vendor/start/neodev.nvim/types/stable" | ||
] | ||
} |
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 @@ | ||
.ci/* |
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
Oops, something went wrong.