Merge pull request #3 from alr86/patch-1 #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on buildscripts from nvim-lua/plenary.nvim and gbprod/cutlass.nvim | |
name: test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
run_tests: | |
name: unit tests | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
nvim-versions: ["stable", "nightly"] | |
steps: | |
- uses: actions/checkout@v3 | |
- run: date +%F > todays-date | |
- name: Setup nvim | |
uses: rhysd/action-setup-vim@v1 | |
with: | |
neovim: true | |
version: ${{ matrix.nvim-versions }} | |
- name: Setup lua | |
uses: leafo/gh-actions-lua@v8 | |
with: | |
luaVersion: "5.1.5" | |
- name: Setup luarocks | |
uses: leafo/gh-actions-luarocks@v4 | |
- name: Setup luacheck | |
run: | | |
luarocks install luacheck | |
- name: Run linter | |
run: luacheck lua/ tests/ | |
- name: Run tests | |
run: nvim --clean --headless -u tests/minimal_init.lua -c "PlenaryBustedDirectory tests/ { minimal_init = 'tests/minimal_init.lua' }" | |
stylua: | |
name: Check lua style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: JohnnyMorganz/stylua-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
version: latest | |
args: --color always --check . |