Skip to content

Commit

Permalink
feat(ci): setup ci workflow and supporting configs
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry committed Jun 22, 2024
1 parent efbfe28 commit 0f455fb
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI
on:
push:
pull_request:
branches:
- main

jobs:
stylua:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run Stylua
uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --color always --check .

selene:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Selene
run: cargo install selene

- name: Run Selene
run: selene --display-style quiet --config ./.selene.toml lua

codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install codespell
run: pip install codespell

- name: Use codespell
run: make spell

generate-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: panvimdoc
uses: kdheepak/panvimdoc@main
with:
vimdoc: telescope-resession
version: "Neovim >= 0.9.0"
titledatepattern: "%Y"
demojify: true
treesitter: true

- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "docs: auto-generate vimdoc"

release:
runs-on: ubuntu-latest
needs: [stylua, selene, codespell, generate-doc]
if: github.ref == 'refs/heads/main'
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
27 changes: 27 additions & 0 deletions .neovim.std.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
base: lua51

globals:
jit:
any: true
vim:
any: true
assert:
args:
- type: bool
- type: string
required: false
after_each:
args:
- type: function
before_each:
args:
- type: function
describe:
args:
- type: string
- type: function
it:
args:
- type: string
- type: function
9 changes: 9 additions & 0 deletions .selene.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
std = ".neovim.std"

[rules]
global_usage = "warn"
multiple_statements = "allow"
incorrect_standard_library_use = "allow"
mixed_table = "allow"
unused_variable = "warn"
unescoped_variables = "warn"
4 changes: 4 additions & 0 deletions .stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
column_width = 120
indent_type = "Spaces"
indent_width = 4
quote_style = "AutoPreferDouble"
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
ifeq ($(OS),Windows_NT)
GREEN=
RESTORE=
else
GREEN="\033[0;32m"
RESTORE="\033[0m"
endif

# make the output of the message appear green
define style_calls
$(eval $@_msg = $(1))
echo ${GREEN}${$@_msg}${RESTORE}
endef

lint: style-lint
@$(call style_calls,"Running selene")
@selene --display-style quiet --config ./.selene.toml lua
@$(call style_calls,"Done!")

.PHONY: lint

style-lint:
@$(call style_calls,"Running stylua check")
@stylua --color always -f ./.stylua.toml --check lua
@$(call style_calls,"Done!")

.PHONY: style-lint

format:
@$(call style_calls,"Running stylua format")
@stylua --color always -f ./.stylua.toml lua
@$(call style_calls,"Done!")

.PHONY: format

spell:
@$(call style_calls,"Running codespell check")
@codespell --quiet-level=2 --check-hidden --skip=./.git,./CHANGELOG.md
@$(call style_calls,"Done!")

.PHONY: spell

spell-write:
@$(call style_calls,"Running codespell write")
@codespell --quiet-level=2 --check-hidden --skip=./.git,./CHANGELOG.md --write-changes
@$(call style_calls,"Done!")

.PHONY: spell-write
Empty file added doc/telescope-resession.txt
Empty file.

0 comments on commit 0f455fb

Please sign in to comment.