Skip to content

Commit f0d9edf

Browse files
authored
ci: use lux (#885)
1 parent 99ff240 commit f0d9edf

13 files changed

Lines changed: 395 additions & 175 deletions

File tree

.github/workflows/luarocks.yml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,22 @@ on:
44
push:
55
tags:
66
- "*"
7-
release:
8-
types:
9-
- created
10-
pull_request:
7+
workflow_dispatch:
118

129
jobs:
1310
luarocks-release:
14-
runs-on: ubuntu-latest
15-
name: LuaRocks upload
11+
runs-on: ubuntu-22.04
1612
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v4
13+
- name: Checkout repository
14+
uses: actions/checkout@v5
15+
16+
- name: Install Lux
17+
uses: lumen-oss/gh-actions-lux@v1
1918
with:
20-
fetch-depth: 0 # Required to count the commits
21-
- name: Get Version
22-
run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
23-
- name: LuaRocks Upload
24-
uses: nvim-neorocks/luarocks-tag-release@v7
19+
version: 0.18.11
20+
21+
- name: Upload
22+
run: |
23+
lx --nvim upload
2524
env:
26-
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
27-
with:
28-
version: ${{ env.LUAROCKS_VERSION }}
29-
detailed_description: |
30-
This plugin automatically configures the rust-analyzer builtin LSP client
31-
and integrates with other Rust tools. See the README's #features section
32-
for more info.
25+
LUX_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}

.github/workflows/nix-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
name: mrcjkb
1717
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
18-
- run: nix flake check -L
18+
- run: nix flake check -Lv
1919

2020
shell:
2121
runs-on: ubuntu-latest

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
test:
9+
name: ${{ matrix.job.target }} - Neovim ${{ matrix.nvim-version }}
10+
runs-on: ${{ matrix.job.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
job:
15+
- { os: ubuntu-24.04, target: x86_64-linux }
16+
nvim-version:
17+
- stable
18+
- nightly
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v5
22+
23+
- name: Install MSVC Compiler Toolchain
24+
uses: ilammy/msvc-dev-cmd@v1
25+
if: endsWith(matrix.job.target, '-msvc')
26+
27+
- name: Setup Neovim
28+
uses: rhysd/action-setup-vim@v1
29+
with:
30+
neovim: true
31+
version: ${{ matrix.nvim-version }}
32+
33+
- name: Install Lux
34+
uses: lumen-oss/gh-actions-lux@v1
35+
with:
36+
version: 0.18.11
37+
38+
- name: Run tests
39+
run: |
40+
lx --nvim test
41+
42+
# TODO: Not stable in Lux yet.
43+
# For now, we use Nix for type checking
44+
# - name: Type checks
45+
# run: |
46+
# lx --nvim check
47+

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
result
22
result-*
33
.direnv
4-
.luarc.json
54
.repro
65
.pre-commit-config.yaml
6+
.lux

.luarc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"workspace": {
3+
"library": [
4+
"$VIMRUNTIME",
5+
".lux/5.1/test_dependencies/5.1/01a3c364614bddff7370223a5a9c4580f8e62d144384148444c518ec5367a59b-mediator_lua@1.1.2-0/src",
6+
".lux/5.1/test_dependencies/5.1/287e827f4a088d41bba04af5f61a13614346c16fe8150eb7c4246e67d6fd163e-lua-term@0.8-1/src",
7+
".lux/5.1/test_dependencies/5.1/316ac0b30e04e86a253d64886f3b110bd0508267474e6b58a3b973bd6857dbf4-penlight@1.14.0-3/src",
8+
".lux/5.1/test_dependencies/5.1/455cd98d50c6191a9685cffcda4ce783efbb957934625e134c39f43bd5df6818-luassert@1.9.0-1/src",
9+
".lux/5.1/test_dependencies/5.1/47b12edcdc032232157ace97bddf34bddd17f6f458095885e62bbd602ad9e9ec-luasystem@0.6.3-1/src",
10+
".lux/5.1/test_dependencies/5.1/4e9592a499c9ced4f8ce366db9db7d9c0dd1424ea8d4c8c16c1550ea3a61a696-say@1.4.1-3/src",
11+
".lux/5.1/test_dependencies/5.1/56b98be57b1a97b869fd8ded0d2c0b9ce0b6b052e2d5abf84d060748617b2c90-busted@2.2.0-1/src",
12+
".lux/5.1/test_dependencies/5.1/6ce29c2c535c40246c386c056f24689344cddb56ec397473931431e6b67694d2-say@1.4.1-3/src",
13+
".lux/5.1/test_dependencies/5.1/832fd9862ce671c0c9777855d4c8b19f9ad9c2679fb5466c3a183785a51b76b0-luafilesystem@1.8.0-1/src",
14+
".lux/5.1/test_dependencies/5.1/a6c5176043cb3de56336b7de119443dbb3d9e024be1d50e06289ad4b4959a2da-lua_cliargs@3.0.2-1/src",
15+
".lux/5.1/test_dependencies/5.1/d85464dc58c62460a1ecb14e6ac773ae615a66a8224b26ceb25d954c6b05ca74-nlua@0.3.2-1/src",
16+
".lux/5.1/test_dependencies/5.1/e4f17b9e67313bbd5e90f425672fc8998dd0bfa43335f7c57ed2de7a799e07a6-dkjson@2.8-1/src"
17+
]
18+
}
19+
}

CONTRIBUTING.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,9 @@ which are checked in CI.
3333

3434
### Running tests
3535

36-
This plugin uses [`busted`](https://lunarmodules.github.io/busted/) for testing.
36+
This plugin uses [`lux`](https://lux.lumen-labs.org) for testing.
3737

38-
The best way to run tests is with Nix (see below),
39-
because this includes tests that take different
40-
envrionments into account (e.g. with/without `rust-analyzer`, `cargo`, ...).
41-
42-
If you do not use Nix, you can run a basic version of the test suite using
43-
`luarocks test`.
44-
For more information, see the [neorocks tutorial](https://github.com/nvim-neorocks/neorocks#without-neolua).
38+
Run `lx test` to run the test suite.
4539

4640
### Vimdoc/tags
4741

flake.lock

Lines changed: 12 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
description = "A fork setup-less and lspconfig-free of rust-tools.nvim";
2+
description = "Supercharge your Rust experience in Neovim";
33

44
inputs = {
55
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
@@ -11,14 +11,7 @@
1111
inputs.nixpkgs.follows = "nixpkgs";
1212
};
1313

14-
neorocks = {
15-
url = "github:nvim-neorocks/neorocks";
16-
inputs = {
17-
flake-parts.follows = "flake-parts";
18-
git-hooks.follows = "git-hooks";
19-
nixpkgs.follows = "nixpkgs";
20-
};
21-
};
14+
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
2215

2316
gen-luarc = {
2417
url = "github:mrcjkb/nix-gen-luarc-json";
@@ -44,7 +37,6 @@
4437
nixpkgs,
4538
flake-parts,
4639
git-hooks,
47-
neorocks,
4840
gen-luarc,
4941
vimcats,
5042
...
@@ -65,15 +57,13 @@
6557
git-hooks.flakeModule
6658
];
6759
perSystem = {
68-
config,
6960
system,
7061
pkgs,
7162
...
7263
}: let
73-
ci-overlay = import ./nix/ci-overlay.nix {
74-
inherit self;
75-
plugin-name = name;
76-
};
64+
neovim-nightly = inputs.neovim-nightly-overlay.packages.${system}.default;
65+
66+
ci-overlay = import ./nix/ci-overlay.nix {inherit neovim-nightly;};
7767

7868
luarc-plugins = with pkgs.lua51Packages;
7969
[
@@ -85,7 +75,7 @@
8575
]);
8676

8777
luarc-nightly = pkgs.mk-luarc {
88-
nvim = pkgs.neovim-nightly;
78+
nvim = neovim-nightly;
8979
plugins = luarc-plugins;
9080
};
9181

@@ -148,35 +138,30 @@
148138
};
149139
};
150140

151-
devShell = pkgs.nvim-nightly-tests.overrideAttrs (oa: {
141+
devShell = pkgs.mkShell {
152142
name = "rustaceanvim devShell";
153143
shellHook = ''
154144
${pre-commit-check.shellHook}
155-
ln -fs ${pkgs.luarc-to-json luarc-nightly} .luarc.json
156145
'';
157-
buildInputs = with git-hooks.packages.${system};
158-
[
159-
pkgs.statix
160-
pkgs.nixd
161-
alejandra
162-
lua-language-server
163-
stylua
164-
luacheck
165-
editorconfig-checker
166-
markdownlint-cli
167-
docgen
168-
]
169-
++ oa.buildInputs;
170-
doCheck = false;
171-
});
146+
buildInputs = with git-hooks.packages.${system}; [
147+
pkgs.lux-cli
148+
pkgs.statix
149+
pkgs.nixd
150+
alejandra
151+
lua-language-server
152+
stylua
153+
editorconfig-checker
154+
markdownlint-cli
155+
docgen
156+
];
157+
};
172158

173159
docgen = pkgs.callPackage ./nix/docgen.nix {inherit vimcats;};
174160
in {
175161
_module.args.pkgs = import nixpkgs {
176162
inherit system;
177163
overlays = [
178164
ci-overlay
179-
neorocks.overlays.default
180165
gen-luarc.overlays.default
181166
plugin-overlay
182167
];
@@ -204,11 +189,6 @@
204189
type-check-stable
205190
type-check-nightly
206191
;
207-
inherit
208-
(pkgs)
209-
nvim-stable-tests
210-
nvim-nightly-tests
211-
;
212192
};
213193
};
214194
flake = {

0 commit comments

Comments
 (0)