From 6af2c7463cee27c0b9d82e9fe882e6c7ab6935f5 Mon Sep 17 00:00:00 2001 From: glepnir Date: Sun, 19 Jan 2025 19:58:59 +0800 Subject: [PATCH] update CI --- .github/workflows/ci.yml | 34 ++-------------------------------- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ README.md | 9 ++------- 3 files changed, 31 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97be435..3763577 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,6 @@ jobs: version: latest args: --check . - docs: runs-on: ubuntu-latest name: pandoc to vimdoc @@ -24,40 +23,11 @@ jobs: - name: panvimdoc uses: kdheepak/panvimdoc@main with: - vimdoc: nvim-plugin-template + vimdoc: guard.nvim treesitter: true - uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: 'chore(doc): auto generate docs' + commit_message: "chore(doc): auto generate docs" commit_user_name: "github-actions[bot]" commit_user_email: "github-actions[bot]@users.noreply.github.com" commit_author: "github-actions[bot] " - - test: - name: Run Test - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v3 - - uses: rhysd/action-setup-vim@v1 - id: vim - with: - neovim: true - version: nightly - - - name: luajit - uses: leafo/gh-actions-lua@v10 - with: - luaVersion: "luajit-openresty" - - - name: luarocks - uses: leafo/gh-actions-luarocks@v4 - - - name: run test - shell: bash - run: | - luarocks install luacheck - luarocks install vusted - vusted ./test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d1a7c24 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Run tests +on: + pull_request: ~ + push: + branches: + - main + +jobs: + build: + name: Run tests + runs-on: ubuntu-latest + strategy: + matrix: + neovim_version: ['nightly', 'stable'] + + steps: + - uses: actions/checkout@v4 + - name: Download stylua + shell: bash + run: | + wget "https://github.com/JohnnyMorganz/StyLua/releases/download/v0.18.0/stylua-linux.zip" -P /home/runner/.local/bin + unzip /home/runner/.local/bin/stylua-linux.zip -d /home/runner/.local/bin + chmod +x /home/runner/.local/bin/stylua + - name: Run tests + uses: nvim-neorocks/nvim-busted-action@v1 + with: + nvim_version: ${{ matrix.neovim_version }} diff --git a/README.md b/README.md index 16d5cd5..b548c8d 100644 --- a/README.md +++ b/README.md @@ -18,19 +18,14 @@ The CI uses `stylua` to format the code; customize the formatting by editing `.s ## Test -Uses [busted](https://lunarmodules.github.io/busted/) for testing. Installs by using `luarocks --lua-version=5.1 install vusted` then runs `vusted ./test` -for your test cases. `vusted` is a wrapper of Busted especially for testing Neovim plugins. - -Create test cases in the `test` folder. Busted expects files in this directory to be named `foo_spec.lua`, with `_spec` as a suffix before the `.lua` file extension. For more usage details please check -[busted usage](https://lunarmodules.github.io/busted/) +See [Running tests locally](https://github.com/nvim-neorocks/nvim-busted-action?tab=readme-ov-file#running-tests-locally) ## CI - Auto generates doc from README. -- Runs the Busted/vusted integration tests +- Runs the [nvim-busted-action](https://github.com/nvim-neorocks/nvim-busted-action) for test. - Lints with `stylua`. - ## More To see this template in action, take a look at my other plugins.