Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/test-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test Setup
description: Install Neovim, Lua 5.1, Luarocks, busted, nlua, and guard.nvim

runs:
using: composite
steps:
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: '5.1'
- uses: hishamhm/gh-actions-luarocks@master
- run: luarocks install busted --local && luarocks install nlua --local
shell: bash
- run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
shell: bash
7 changes: 6 additions & 1 deletion .github/scripts/install-binary-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ while read -r name type url extra; do
chmod +x "$dest/$name"
rm -rf "$tmpdir"
;;
gz)
wget -q "$url" -O "$dest/$name.gz"
gunzip "$dest/$name.gz"
chmod +x "$dest/$name"
;;
jar)
wget -q "$url" -O "$dest/$name.jar"
printf '#!/usr/bin/env bash\nexec java -jar "%s/%s.jar" "$@"\n' "$(cd "$dest" && pwd)" "$name" > "$dest/$name"
printf '#!/bin/sh\njava -jar %s/%s.jar "$@"\n' "$dest" "$name" > "$dest/$name"
chmod +x "$dest/$name"
;;
esac
Expand Down
6 changes: 6 additions & 0 deletions .github/tools/binary-apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fish
jq
libxml2-utils
pgformatter
shellcheck
zsh
16 changes: 12 additions & 4 deletions .github/tools/binary.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
alejandra bin https://github.com/kamadorueda/alejandra/releases/download/4.0.0/alejandra-x86_64-unknown-linux-musl
buf bin https://github.com/bufbuild/buf/releases/download/v1.47.2/buf-Linux-x86_64
hadolint bin https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
cbfmt tar https://github.com/lukas-reineke/cbfmt/releases/download/v0.2.0/cbfmt_linux-x86_64_v0.2.0.tar.gz cbfmt_linux-x86_64_v0.2.0/cbfmt
checkmake bin https://github.com/mrtazz/checkmake/releases/download/0.2.2/checkmake-0.2.2.linux.amd64
cljfmt tar https://github.com/weavejester/cljfmt/releases/download/0.15.6/cljfmt-0.15.6-linux-amd64-static.tar.gz cljfmt
deno zip https://github.com/denoland/deno/releases/download/v2.1.4/deno-x86_64-unknown-linux-gnu.zip
detekt jar https://github.com/detekt/detekt/releases/download/v1.23.7/detekt-cli-1.23.7-all.jar
dprint zip https://github.com/dprint/dprint/releases/download/0.49.0/dprint-x86_64-unknown-linux-gnu.zip
google-java-format jar https://github.com/google/google-java-format/releases/download/v1.34.1/google-java-format-1.34.1-all-deps.jar
hadolint bin https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
hlint tar https://github.com/ndmitchell/hlint/releases/download/v3.10/hlint-3.10-x86_64-linux.tar.gz hlint-3.10/hlint
ktfmt jar https://repo1.maven.org/maven2/com/facebook/ktfmt/0.52/ktfmt-0.52-jar-with-dependencies.jar
ktlint bin https://github.com/pinterest/ktlint/releases/download/1.8.0/ktlint
latexindent bin https://github.com/cmhughes/latexindent.pl/releases/download/V3.24.4/latexindent-linux
ormolu zip https://github.com/tweag/ormolu/releases/download/0.8.0.2/ormolu-x86_64-linux.zip
shfmt bin https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_linux_amd64
swiftformat zip https://github.com/nicklockwood/SwiftFormat/releases/download/0.55.3/swiftformat_linux.zip swiftformat_linux
cbfmt tar https://github.com/lukas-reineke/cbfmt/releases/download/v0.2.0/cbfmt_linux-x86_64_v0.2.0.tar.gz cbfmt_linux-x86_64_v0.2.0/cbfmt
dprint zip https://github.com/dprint/dprint/releases/download/0.49.0/dprint-x86_64-unknown-linux-gnu.zip
ktlint bin https://github.com/pinterest/ktlint/releases/download/1.8.0/ktlint
tombi gz https://github.com/tombi-toml/tombi/releases/download/v0.7.27/tombi-cli-0.7.27-x86_64-unknown-linux-musl.gz
typos tar https://github.com/crate-ci/typos/releases/download/v1.43.3/typos-v1.43.3-x86_64-unknown-linux-musl.tar.gz ./typos
typstyle bin https://github.com/typstyle-rs/typstyle/releases/download/v0.14.4/typstyle-x86_64-unknown-linux-gnu
2 changes: 2 additions & 0 deletions .github/tools/go.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
golang.org/x/tools/cmd/goimports@latest
mvdan.cc/gofumpt@latest
github.com/segmentio/golines@latest
github.com/google/yamlfmt/cmd/yamlfmt@latest
1 change: 1 addition & 0 deletions .github/tools/npm.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
prettier
@fsouza/prettierd
@biomejs/biome
sql-formatter
@taplo/cli
Expand Down
5 changes: 5 additions & 0 deletions .github/tools/pip.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
autopep8
black
cmake-format
codespell
cpplint
djhtml
docformatter
flake8
isort
mdformat
mypy
pylint
ruff
sqlfluff
yamlfix
yapf
181 changes: 57 additions & 124 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: ./.github/actions/test-setup
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Install tools
run: |
pip install -q -r .github/tools/pip.txt
luarocks install busted --local
luarocks install nlua --local
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
run: pip install -q -r .github/tools/pip.txt
- name: Run tests
run: |
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
Expand All @@ -48,24 +36,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: ./.github/actions/test-setup
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Install tools
run: |
xargs npm install -g < .github/tools/npm.txt
luarocks install busted --local
luarocks install nlua --local
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
run: xargs npm install -g < .github/tools/npm.txt
- name: Run tests
run: |
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
Expand All @@ -75,26 +51,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: ./.github/actions/test-setup
- uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Install tools
run: |
xargs -L1 go install < .github/tools/go.txt
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
luarocks install busted --local
luarocks install nlua --local
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
- name: Run tests
run: |
export PATH="$HOME/go/bin:$PATH"
Expand All @@ -105,26 +70,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: ./.github/actions/test-setup
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Install test tools
run: |
luarocks install busted --local
luarocks install nlua --local
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
- name: Run tests
run: |
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
Expand All @@ -134,22 +86,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- uses: ./.github/actions/test-setup
- name: Install tools
run: |
luarocks install busted --local
luarocks install nlua --local
luarocks install luacheck --local
luarocks install fnlfmt --local
bash .github/scripts/install-binary-tools.sh "$HOME/.local/bin" .github/tools/lua-binary.txt
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
- name: Run tests
run: |
export PATH="$HOME/.local/bin:$PATH"
Expand All @@ -160,26 +102,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
- uses: ./.github/actions/test-setup
- uses: dart-lang/setup-dart@v1
- uses: mlugg/setup-zig@v2
with:
neovim: true
version: nightly
version: 0.15.2
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Install tools
run: |
sudo apt-get install -y zsh shellcheck
luarocks install busted --local
luarocks install nlua --local
xargs sudo apt-get install -y < .github/tools/binary-apt.txt
bash .github/scripts/install-binary-tools.sh "$HOME/.local/bin"
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
- name: Run tests
run: |
export PATH="$HOME/.local/bin:$PATH"
Expand All @@ -190,21 +125,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- uses: ./.github/actions/test-setup
- name: Install tools
run: |
xargs sudo apt-get install -y < .github/tools/apt.txt
luarocks install busted --local
luarocks install nlua --local
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
run: xargs sudo apt-get install -y < .github/tools/apt.txt
- name: Run tests
run: |
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
Expand All @@ -214,24 +137,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: ./.github/actions/test-setup
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Install tools
run: |
dotnet tool install -g csharpier
luarocks install busted --local
luarocks install nlua --local
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
run: dotnet tool install -g csharpier
- name: Run tests
run: |
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
Expand All @@ -241,31 +152,53 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: ./.github/actions/test-setup
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- uses: leso-kn/gh-actions-lua@master
with:
luaVersion: "5.1"
- uses: hishamhm/gh-actions-luarocks@master
- name: Install tools
run: gem install rubocop
- name: Run tests
run: |
gem install rubocop bundler
luarocks install busted --local
luarocks install nlua --local
- name: Setup rubocop Gemfile
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
busted --lua nlua test/ruby/*_spec.lua

test-elixir:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test-setup
- uses: erlef/setup-beam@v1
with:
otp-version: '27'
elixir-version: '1.17'
- name: Run tests
run: |
mkdir -p /tmp/rubocop-test
printf "source 'https://rubygems.org'\ngem 'rubocop'\n" > /tmp/rubocop-test/Gemfile
cd /tmp/rubocop-test && bundle install
- name: Clone guard.nvim
run: git clone --depth 1 https://github.com/nvimdev/guard.nvim && mv guard.nvim/lua/guard lua/
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
busted --lua nlua test/elixir/*_spec.lua

test-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test-setup
- uses: cachix/install-nix-action@v27
- name: Install tools
run: nix profile install nixpkgs#nixfmt-rfc-style
- name: Run tests
run: |
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
busted --lua nlua test/ruby/*_spec.lua
busted --lua nlua test/nix/*_spec.lua

test-swift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test-setup
- uses: swift-actions/setup-swift@v2
with:
swift-version: '6.0'
- name: Run tests
run: |
export LUA_PATH="lua/?.lua;lua/?/init.lua;$LUA_PATH"
busted --lua nlua test/swift/*_spec.lua
Loading
Loading