Skip to content

Add tests as a github action job #30

Add tests as a github action job

Add tests as a github action job #30

Workflow file for this run

name: Neotest-go GitHub Actions
on:
[pull_request, workflow_dispatch]
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- name: Check out PR branch
uses: actions/checkout@v3
- name: Check formatting
uses: JohnnyMorganz/stylua-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
args: --check .
tests:
runs-on: ubuntu-latest
steps:
- name: Check out PR branch
uses: actions/checkout@v3
- name: Prepare dependencies
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/${{ runner.os.rev }}" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter ~/.local/share/nvim/site/pack/vendor/start/nvim-treesitter
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --headless -c 'TSInstallSync lua | quit'
- name: Run tests
run: nvim --headless -c ':PlenaryBustedDirectory lua/spec'