Skip to content

Commit

Permalink
ci(selene): migrate 'luacheck' to 'selene' (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 authored Mar 11, 2024
1 parent b673377 commit 1c37b1c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 19 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand All @@ -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"
Expand All @@ -60,7 +61,6 @@ jobs:
- name: Run Tests
shell: bash
run: |
luarocks install luacheck
luarocks install vusted
vusted --shuffle ./test
code_coverage:
Expand All @@ -80,7 +80,6 @@ jobs:
- name: Run Tests
shell: bash
run: |
luarocks install luacheck
luarocks install luacov
luarocks install vusted
vusted --coverage ./test
Expand All @@ -104,7 +103,7 @@ jobs:
name: Release
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- luacheck
- lint
- unit_test
- code_coverage
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions .luacheckrc

This file was deleted.

8 changes: 8 additions & 0 deletions selene.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
std = "vim"

exclude = []

[lints]
mixed_table = "allow"
unused_variable = "allow"
incorrect_standard_library_use = "allow"
18 changes: 18 additions & 0 deletions vim.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[selene]
base = "lua51"

[vim]
any = true

[it]
any = true

[describe]
any = true

[before_each]
any = true

[assert]
any = true

0 comments on commit 1c37b1c

Please sign in to comment.