Skip to content

Commit b4fe62a

Browse files
author
BirdeeHub
committed
ci(flake): improve how the tests are ran in the flake
Use installCheckPhase until the PR to fix checkPhase for buildLuarocksPackage is accepted
1 parent 11caea3 commit b4fe62a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

flake.nix

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
version = "scm-1";
2727
knownRockspec = "${self}/${APPNAME}-scm-1.rockspec";
2828
src = self;
29+
installCheckPhase = ''
30+
runHook preInstallCheck
31+
luarocks test
32+
runHook postInstallCheck
33+
'';
2934
}) {};
3035
};
3136
}) l_pkg_enum;
@@ -44,15 +49,6 @@
4449
};
4550
};
4651
};
47-
in {
48-
overlays.default = overlay;
49-
checks = forAllSys (system: let
50-
pkgs = getpkgswithoverlay system;
51-
mkCheck = luaname: _: pkgs.runCommandCC ("tests-tom" + luaname) {
52-
src = self;
53-
lua = (pkgs.${luaname}.withPackages (lp: [lp.${APPNAME}])).interpreter;
54-
} "$lua $src/tests/test.lua | tee $out";
55-
in builtins.mapAttrs mkCheck l_pkg_enum);
5652
packages = forAllSys (system: let
5753
pkgs = getpkgswithoverlay system;
5854
in (with builtins; pkgs.lib.pipe l_pkg_enum [
@@ -66,6 +62,10 @@
6662
default = pkgs.vimPlugins.${APPNAME};
6763
"vimPlugins-${APPNAME}" = pkgs.vimPlugins.${APPNAME};
6864
});
65+
in {
66+
overlays.default = overlay;
67+
inherit packages;
68+
checks = forAllSys (system: builtins.mapAttrs (_: p: p.overrideAttrs { doInstallCheck = true; }) packages.${system});
6969
devShells = forAllSys (system: let
7070
pkgs = getpkgs system;
7171
lua = pkgs.luajit.withPackages (lp: [lp.inspect lp.cjson lp.toml-edit lp.luarocks]);

0 commit comments

Comments
 (0)