Skip to content

Commit

Permalink
Merge branch 'update-ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
EricDriussi committed Jul 14, 2023
2 parents ec7d912 + 1f70015 commit 195aa61
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
on: [push, pull_request]
name: default
name: Test

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

- uses: JohnnyMorganz/stylua-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -18,13 +19,13 @@ jobs:
name: test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Download tarball
run: curl -OL https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz

- name: Prepare
run: |
curl -OL https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.deb
sudo apt install ./nvim-linux64.deb
- name: Extract tarball
run: tar xzvf nvim-linux64.tar.gz

- name: run tests
run: make test
run: make test-ci
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ lint: ## Linting & formatting

TEST_INIT := tests/minimal_init.lua
CLEAN_SESS := find . -type f -name '*.r.vim' -delete
NVIM_BIN := nvim

ALL_TESTS := nvim --headless --noplugin -u $(TEST_INIT) -c "PlenaryBustedDirectory tests {minimal_init='$(TEST_INIT)'; timeout=500}" && $(CLEAN_SESS)
ONE_TEST := nvim --headless --noplugin -u $(TEST_INIT) -c "PlenaryBustedFile $(FILE_PATH)" && $(CLEAN_SESS)
ALL_TESTS = $(NVIM_BIN) --headless --noplugin -u $(TEST_INIT) -c "PlenaryBustedDirectory tests {minimal_init='$(TEST_INIT)'; timeout=500}" && $(CLEAN_SESS)
ONE_TEST = $(NVIM_BIN) --headless --noplugin -u $(TEST_INIT) -c "PlenaryBustedFile $(FILE_PATH)" && $(CLEAN_SESS)

.PHONY: test
test: ## Run test given test or all tests
Expand All @@ -43,3 +44,8 @@ else
$(ALL_TESTS); \
done
endif

.PHONY: test-ci
test-ci: NVIM_BIN=./nvim-linux64/bin/nvim ## Run all test in CI mode
test-ci:
@$(ALL_TESTS)

0 comments on commit 195aa61

Please sign in to comment.