Merge branch 'chore/tests' into 'main'

chore: add tests using nixtest

See merge request rensa-nix/core!2
This commit is contained in:
TECHNOFAB 2026-01-20 12:47:19 +01:00
commit 9bbb923a35
9 changed files with 293 additions and 1 deletions

View file

@ -3,8 +3,19 @@
in
cilib.mkCI {
pipelines."default" = {
stages = ["build" "deploy"];
stages = ["test" "build" "deploy"];
jobs = {
"test:lib" = {
stage = "test";
script = [
"nix run .#tests -- --junit=junit.xml"
];
allow_failure = true;
artifacts = {
when = "always";
reports.junit = "junit.xml";
};
};
"docs" = {
stage = "build";
script = [

19
cells/repo/flake.lock generated
View file

@ -69,12 +69,31 @@
"type": "gitlab"
}
},
"nixtest-lib": {
"locked": {
"dir": "lib",
"lastModified": 1765728058,
"narHash": "sha256-V3FXECl1oTxEtGteNz3o3GJs/X8asSn1TxRpZ2F+htU=",
"owner": "TECHNOFAB",
"repo": "nixtest",
"rev": "2477ad31ae3aa4134e1bb5eeddbebe0cb64ccb57",
"type": "gitlab"
},
"original": {
"dir": "lib",
"owner": "TECHNOFAB",
"ref": "v1.2.1",
"repo": "nixtest",
"type": "gitlab"
}
},
"root": {
"inputs": {
"devshell": "devshell",
"devtools-lib": "devtools-lib",
"nix-gitlab-ci-lib": "nix-gitlab-ci-lib",
"nixmkdocs": "nixmkdocs",
"nixtest-lib": "nixtest-lib",
"soonix-lib": "soonix-lib",
"treefmt-nix": "treefmt-nix"
}

View file

@ -5,6 +5,7 @@
soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib";
nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.1.2?dir=lib";
devtools-lib.url = "gitlab:rensa-nix/devtools?dir=lib";
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest/v1.2.1?dir=lib";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
flake = false;
@ -18,6 +19,8 @@
doclib = i.nixmkdocs.lib {inherit (i.parent) pkgs;};
soonix = i.soonix-lib.lib {inherit (i.parent) pkgs;};
cilib = i.nix-gitlab-ci-lib.lib {inherit (i.parent) pkgs;};
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
rensa = import "${i.parent.self}/lib" {inherit (i.parent.pkgs) lib;};
treefmt = import i.treefmt-nix;
};
}

10
cells/repo/tests.nix Normal file
View file

@ -0,0 +1,10 @@
{inputs, ...}: let
inherit (inputs) pkgs ntlib rensa;
in {
tests = ntlib.mkNixtest {
modules = ntlib.autodiscover {dir = "${inputs.self}/tests";};
args = {
inherit pkgs ntlib rensa;
};
};
}