Skip to content

Commit

Permalink
build: run unit tests on push and PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronr committed Jul 18, 2024
1 parent c61321b commit 6a59e0a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# From
# https://github.com/shortcuts/neovim-plugin-boilerplate/blob/main/.github/workflows/main.yml

name: tests

on:
push:
pull_request:
types: [opened, synchronize]

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

- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check . -g '*.lua' -g '!deps/'

test:
runs-on: ubuntu-latest
timeout-minutes: 2
strategy:
matrix:
neovim_version: ["v0.7.2", "v0.8.3", "v0.9.5", "v0.10.0", "nightly"]

steps:
- uses: actions/checkout@v4

- run: date +%F > todays-date

- name: restore cache for today's nightly.
uses: actions/cache@v4
with:
path: _neovim
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}

- name: setup neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim_version }}

- name: install ripgrep
run: |
sudo apt-get update
sudo apt-get install -y ripgrep
- name: run tests
run: |
make test

0 comments on commit 6a59e0a

Please sign in to comment.