aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/tests.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/tests.yml')
-rw-r--r--.github/workflows/tests.yml65
1 files changed, 65 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..ca71ef2
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,65 @@
+name: Run tests
+
+on: [push, pull_request]
+
+jobs:
+ luacheck:
+ name: Luacheck
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Prepare
+ run: |
+ sudo apt-get update
+ sudo add-apt-repository universe
+ sudo apt install luarocks -y
+ sudo luarocks install luacheck
+
+ - name: Run Luacheck
+ run: luacheck .
+
+ typecheck:
+ name: typecheck
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: actions/checkout@v3
+ - uses: stevearc/nvim-typecheck-action@v1
+ with:
+ path: lua
+
+ stylua:
+ name: StyLua
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: actions/checkout@v3
+ - name: Stylua
+ uses: JohnnyMorganz/stylua-action@v3
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ version: v0.15.2
+ args: --check .
+
+ release:
+ name: release
+
+ if: ${{ github.ref == 'refs/heads/master' }}
+ needs:
+ - luacheck
+ - stylua
+ - typecheck
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: google-github-actions/release-please-action@v3
+ id: release
+ with:
+ release-type: simple
+ package-name: conform.nvim
+ - uses: actions/checkout@v3
+ - uses: rickstaa/action-create-tag@v1
+ if: ${{ steps.release.outputs.release_created }}
+ with:
+ tag: stable
+ message: "Current stable release: ${{ steps.release.outputs.tag_name }}"
+ tag_exists_error: false
+ force_push_tag: true