ci(selene): migrate 'luacheck' to 'selene' (#128)

This commit is contained in:
linrongbin16 2024-03-11 11:34:18 +08:00 committed by GitHub
parent b673377c50
commit 1c37b1cd06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 40 additions and 19 deletions

View file

@ -6,19 +6,18 @@ on:
push:
branches:
- main
- master
jobs:
conventional_commit:
name: Conventional Commit
commit:
name: Commit
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ytanikin/PRConventionalCommits@1.1.0
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","break"]'
luacheck:
name: Lua check
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -28,15 +27,17 @@ jobs:
level: Information
configpath: ".luarc.json"
neodev-version: stable
- uses: lunarmodules/luacheck@v1
with:
args: lua --config .luacheckrc
- uses: cargo-bins/cargo-binstall@main
- name: Selene
run: |
cargo binstall --no-confirm selene
selene --config selene.toml ./lua
- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --config-path .stylua.toml ./lua ./test
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ github.ref != 'refs/heads/main' }}
with:
commit_message: "chore(pr): auto-commit"
@ -60,7 +61,6 @@ jobs:
- name: Run Tests
shell: bash
run: |
luarocks install luacheck
luarocks install vusted
vusted --shuffle ./test
code_coverage:
@ -80,7 +80,6 @@ jobs:
- name: Run Tests
shell: bash
run: |
luarocks install luacheck
luarocks install luacov
luarocks install vusted
vusted --coverage ./test
@ -104,7 +103,7 @@ jobs:
name: Release
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- luacheck
- lint
- unit_test
- code_coverage
runs-on: ubuntu-latest

View file

@ -1,4 +0,0 @@
globals = { "vim", "describe", "before_each", "it", "assert" }
max_line_length = 200
unused = false
unused_args = false

8
selene.toml Normal file
View file

@ -0,0 +1,8 @@
std = "vim"
exclude = []
[lints]
mixed_table = "allow"
unused_variable = "allow"
incorrect_standard_library_use = "allow"

18
vim.toml Normal file
View file

@ -0,0 +1,18 @@
[selene]
base = "lua51"
[vim]
any = true
[it]
any = true
[describe]
any = true
[before_each]
any = true
[assert]
any = true