Skip to content

Commit

Permalink
ci: add makefile and github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Feb 18, 2024
1 parent b84cdf2 commit bd23d68
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: format

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: 0.17.1
args: --check .
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: install luacheck
run: |
sudo apt-get update
sudo apt-get install lua-check
- name: lint
run: make lint
33 changes: 33 additions & 0 deletions .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: push-to-luarocks

on:
push:
tags:
- '*'
release:
types:
- created # Triggered by release-please
pull_request: # Tests a local luarocks install without publishing on PRs
workflow_dispatch: # Allow manual trigger

jobs:
luarocks-upload:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to count the commits
- name: get version
# Tags created by GitHub releases don't trigger push: tags workflows
# So we have to determine the tag manually.
run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: luarocks upload
uses: nvim-neorocks/luarocks-tag-release@v5
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
version: ${{ env.LUAROCKS_VERSION }}
detailed_description: |
`deadcolumn.nvim` assists you to maintain a specific column width
in your code by gradually displaying the colorcolumn as you
approaches it.
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: release-please

on:
push:
branches:
- master
permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-22.04
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: deadcolumn.nvim
2 changes: 2 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
globals = { 'vim' }
max_line_length = false
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.PHONY: all
all: format-check lint

.PHONY: format-check
format-check:
stylua . --check

.PHONY: format
format:
stylua .

.PHONY: lint
lint:
luacheck .

0 comments on commit bd23d68

Please sign in to comment.