Skip to content

Commit

Permalink
refactor!: only maintain latest stable version (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 authored Nov 22, 2024
1 parent 9461aef commit 17b8d84
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 1,290 deletions.
67 changes: 25 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --config-path .stylua.toml ./lua ./spec
- name: Add _system.lua
if: ${{ github.ref != 'refs/heads/main' }}
run: |
echo "pwd"
echo $PWD
git clone --depth=1 https://github.com/neovim/neovim.git ~/.neovim
cp ~/.neovim/runtime/lua/vim/_system.lua ./lua/commons/_system.lua
sed -i 's/vim.uv/vim.uv or vim.loop/g' ./lua/commons/_system.lua
sed -i '1 i\---@diagnostic disable' ./lua/commons/_system.lua
- name: Add uri.lua
if: ${{ github.ref != 'refs/heads/main' }}
run: |
echo "pwd"
echo $PWD
cp ~/.neovim/runtime/lua/vim/uri.lua ./lua/commons/_uri.lua
sed -i '1 i\---@diagnostic disable' ./lua/commons/_uri.lua
- name: Add async.lua
if: ${{ github.ref != 'refs/heads/main' }}
run: |
Expand Down Expand Up @@ -91,20 +75,14 @@ jobs:
os: ubuntu-latest
- nvim_version: nightly
os: ubuntu-latest
- nvim_version: v0.9.0
os: ubuntu-latest
- nvim_version: stable
os: macos-latest
- nvim_version: nightly
os: macos-latest
- nvim_version: v0.9.0
os: macos-latest
- nvim_version: stable
os: windows-latest
- nvim_version: nightly
os: windows-latest
- nvim_version: v0.9.0
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -116,34 +94,39 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: "luajit-2.1.0-beta3"
luaVersion: "luajit-openresty"
if: ${{ !startsWith(matrix.os, 'windows') }}
- uses: leafo/gh-actions-luarocks@v4
if: ${{ !startsWith(matrix.os, 'windows') }}
- uses: notomo/action-setup-nvim-lua@v1
if: ${{ startsWith(matrix.os, 'windows') }}
- name: Run Test Cases
run: |
luarocks install luacov
luarocks --lua-version=5.1 install vusted
vusted --coverage ./spec
- name: Check Coverage Reports
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
echo "ls ."
ls -l .
echo "run luacov"
luacov
echo "ls ."
ls -l .
echo "cat ./luacov.report.out"
cat ./luacov.report.out
- uses: codecov/codecov-action@v4
if: ${{ !startsWith(matrix.os, 'windows') }}
with:
files: luacov.report.out
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
vusted ./spec
# - name: Run Test Cases
# run: |
# luarocks install luacov
# luarocks install luacov-reporter-lcov
# luarocks --lua-version=5.1 install vusted
# vusted --coverage ./spec
# echo "ls -l ."
# ls -l .
# - name: Check Coverage Reports
# if: ${{ !startsWith(matrix.os, 'windows') }}
# run: |
# echo "luacov -r lcov"
# luacov -r lcov
# echo "ls -la ."
# ls -la .
# echo "tail ./luacov.report.out"
# tail -n 50 ./luacov.report.out
# - uses: codecov/codecov-action@v4
# if: ${{ !startsWith(matrix.os, 'windows') }}
# with:
# files: luacov.report.out
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
name: Release
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# commons.nvim

<p>
<a href="https://github.com/neovim/neovim/releases/v0.9.0"><img alt="require" src="https://img.shields.io/badge/require-0.9%2B-blue" /></a>
<a href="https://github.com/neovim/neovim/releases/v0.10.0"><img alt="require" src="https://img.shields.io/badge/require-0.10%2B-blue" /></a>
<a href="https://luarocks.org/modules/linrongbin16/commons.nvim"><img alt="luarocks" src="https://img.shields.io/luarocks/v/linrongbin16/commons.nvim" /></a>
<a href="https://github.com/linrongbin16/commons.nvim/actions/workflows/ci.yml"><img alt="ci.yml" src="https://img.shields.io/github/actions/workflow/status/linrongbin16/commons.nvim/ci.yml?label=ci" /></a>
<a href="https://app.codecov.io/github/linrongbin16/commons.nvim"><img alt="codecov" src="https://img.shields.io/codecov/c/github/linrongbin16/commons.nvim/main?label=codecov" /></a>
<!-- <a href="https://app.codecov.io/github/linrongbin16/commons.nvim"><img alt="codecov" src="https://img.shields.io/codecov/c/github/linrongbin16/commons.nvim/main?label=codecov" /></a> -->
</p>

<p align="center"><i>
Expand All @@ -23,14 +23,12 @@ This lua library includes multiple modules:

> [!NOTE]
>
> This library keeps up with the latest Neovim stable version, support until the last legacy version, earlier versions are dropped for maintenance reason, i.e. (at the time of writing, 2024-05-27), stable is 0.10, last legacy is 0.9, nightly is 0.11, thus this plugin supports 0.9+.
> This library only supports latest stable and nightly version, since there are many API level break changes and limitations that are hard to handle in lua side.
Please check [documentation](https://linrongbin16.github.io/commons.nvim) for more details.

## Embedded Libraries

- [\_system.lua](https://github.com/neovim/neovim/blob/master/runtime/lua/vim/_system.lua): Neovim [vim.system()](<https://neovim.io/doc/user/lua.html#vim.system()>) source file.
- [uri.lua](https://github.com/neovim/neovim/blob/master/runtime/lua/vim/uri.lua): Neovim [vim.uri_encode()](<https://neovim.io/doc/user/lua.html#vim.uri_encode()>) source file.
- [async.lua](https://github.com/lewis6991/async.nvim): Small aync library for Neovim plugins.
- [colors.lua](http://sputnik.freewisdom.org/lib/colors/): HSL Color Theory Computation in Lua.

Expand Down
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ coverage:
status:
project:
default:
threshold: 90%
threshold: 80%
patch:
default:
threshold: 90%
threshold: 80%
ignore:
- "lua/commons/_system.lua"
- "lua/commons/_uri.lua"
Expand Down
Loading

0 comments on commit 17b8d84

Please sign in to comment.