ivy.nvim/.github/workflows/ci.yml
Ade Attwood a2287f1179 ci: update the test command for better output
Summary:

Now we are running the tests in neovim we get some output printed to stderr.
This is not helpful in the test output, and obfuscate errors.

This throws any unneeded output to `/dev/null` so we can focus of the tests
that have failed. It also moves over to using TAP output for a more descriptive
out put in CI.

Test Plan:

CI, running the test will validate this
2024-06-30 15:00:28 +01:00

85 lines
2 KiB
YAML

name: CI
on:
push: { branches: ["0.x"] }
pull_request: { branches: ["0.x"] }
jobs:
luacheck:
name: Luacheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install luarocks
run: sudo apt update && sudo apt install -y luarocks
- name: Install luacheck
run: sudo luarocks install luacheck
- name: Run luacheck
run: luacheck .
stylua:
name: StyLua
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run stylua
uses: JohnnyMorganz/stylua-action@v4.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
cargo-format:
name: Cargo Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Lint
run: cargo fmt --check
test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up rust
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: sudo apt update && sudo apt install -y build-essential luarocks
- name: Install busted
run: sudo luarocks install busted
- name: Install neovim
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
- name: Build
run: cargo build --release
- name: Run tests
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
nvim -l ./scripts/busted.lua -o TAP ./lua/ivy/ 2> /dev/null