mirror of
https://gitlab.com/rensa-nix/devshell.git
synced 2025-12-10 21:30:07 +01:00
feat: add CI, improve benchmark, fix issue statix created and remove statix
This commit is contained in:
parent
5fee6ef12a
commit
560aaf0f15
9 changed files with 118 additions and 13 deletions
5
.gitlab-ci.yml
Normal file
5
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Generated by soonix, DO NOT EDIT
|
||||
include:
|
||||
- component: gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci@3.0.0-alpha.2
|
||||
inputs:
|
||||
version: 3.0.0-alpha.2
|
||||
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -37,11 +37,11 @@
|
|||
},
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1755264589,
|
||||
"narHash": "sha256-g8KjU4D/nxpMjCLQNP90VAAWUH89yvONRfChyhhzq4c=",
|
||||
"lastModified": 1756370106,
|
||||
"narHash": "sha256-l84ojcHuQWBwn4BRxQsMMfQpcq/Az/sHh/hSqFgVtyg=",
|
||||
"owner": "rensa-nix",
|
||||
"repo": "core",
|
||||
"rev": "9f20f8c94b09a1c85356f8340ebe0a339b0d32e6",
|
||||
"rev": "9c1a29fa9ba7cbbb78b9e47eb8afbcd29303a3b4",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
(simple "tests")
|
||||
(simple "benchmark")
|
||||
(simple "docs")
|
||||
(simple "ci")
|
||||
];
|
||||
}
|
||||
{
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
["repo" "tests"]
|
||||
["repo" "benchmark"]
|
||||
["repo" "docs"]
|
||||
["repo" "ci" "packages"]
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
prefix,
|
||||
...
|
||||
} @ args: let
|
||||
vals = filter (key: args.${key} != null && args.${key}) [
|
||||
vals = filter (key: args.${key} != null && args.${key} != false) [
|
||||
"eval"
|
||||
"prefix"
|
||||
"unset"
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ in {
|
|||
runtimeInputs = [pkgs.hyperfine];
|
||||
text = ''
|
||||
echo "Comparison cases first:"
|
||||
hyperfine -w 3 \
|
||||
'nix-instantiate ${inputs.self}/benchmark/shared.nix' \
|
||||
'nix-instantiate ${inputs.self}/benchmark/empty.nix'
|
||||
hyperfine -w 5 \
|
||||
'nix-instantiate ${inputs.self}/benchmark/shared.nix --quiet --quiet --quiet' \
|
||||
'nix-instantiate ${inputs.self}/benchmark/empty.nix --quiet --quiet --quiet'
|
||||
echo "Now real benchmark:"
|
||||
hyperfine -w 3 \
|
||||
'nix-instantiate ${inputs.self}/benchmark/nixpkgs-shell.nix' \
|
||||
'nix-instantiate ${inputs.self}/benchmark/devshell.nix'
|
||||
hyperfine -w 5 \
|
||||
'nix-instantiate ${inputs.self}/benchmark/nixpkgs-shell.nix --quiet --quiet --quiet' \
|
||||
'nix-instantiate ${inputs.self}/benchmark/devshell.nix --quiet --quiet --quiet'
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
51
nix/repo/ci.nix
Normal file
51
nix/repo/ci.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) cilib;
|
||||
in
|
||||
cilib.mkCI {
|
||||
pipelines."default" = {
|
||||
stages = ["test" "build" "deploy"];
|
||||
jobs = {
|
||||
"test" = {
|
||||
stage = "test";
|
||||
script = [
|
||||
"nix run .#tests -- --junit=junit.xml"
|
||||
];
|
||||
allow_failure = true;
|
||||
artifacts = {
|
||||
when = "always";
|
||||
reports.junit = "junit.xml";
|
||||
};
|
||||
};
|
||||
"benchmark" = {
|
||||
stage = "test";
|
||||
script = [
|
||||
"nix run .#bench"
|
||||
];
|
||||
};
|
||||
"docs" = {
|
||||
stage = "build";
|
||||
script = [
|
||||
# sh
|
||||
''
|
||||
nix build .#docs:default
|
||||
mkdir -p public
|
||||
cp -r result/. public/
|
||||
''
|
||||
];
|
||||
artifacts.paths = ["public"];
|
||||
};
|
||||
"pages" = {
|
||||
nix.enable = false;
|
||||
image = "alpine:latest";
|
||||
stage = "deploy";
|
||||
script = ["true"];
|
||||
artifacts.paths = ["public"];
|
||||
rules = [
|
||||
{
|
||||
"if" = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,18 +1,24 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) pkgs devshell treefmt;
|
||||
{
|
||||
inputs,
|
||||
cell,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs) pkgs devshell treefmt soonix;
|
||||
inherit (cell) ci;
|
||||
in {
|
||||
default = devshell.mkShell {
|
||||
imports = [soonix.devshellModule];
|
||||
packages = [
|
||||
pkgs.nil
|
||||
(treefmt.mkWrapper pkgs {
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
statix.enable = true;
|
||||
deadnix.enable = true;
|
||||
mdformat.enable = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
soonix.hooks.ci = ci.soonix;
|
||||
meta = {
|
||||
enableMenu = true;
|
||||
showMenu = "always";
|
||||
|
|
|
|||
37
nix/repo/flake.lock
generated
37
nix/repo/flake.lock
generated
|
|
@ -1,5 +1,23 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nix-gitlab-ci-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1756974596,
|
||||
"narHash": "sha256-KxQj76sUqvPNtrqzNWMZeOWqTitc0aFCYj7UZzToiEA=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"rev": "00cf5b83c6c46698fba12a54b9cc15c6d4e5a4dd",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"ref": "3.0.0-alpha.2",
|
||||
"repo": "nix-gitlab-ci",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"nixmkdocs": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
|
|
@ -36,11 +54,30 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nix-gitlab-ci-lib": "nix-gitlab-ci-lib",
|
||||
"nixmkdocs": "nixmkdocs",
|
||||
"nixtest-lib": "nixtest-lib",
|
||||
"soonix-lib": "soonix-lib",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
}
|
||||
},
|
||||
"soonix-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1757424411,
|
||||
"narHash": "sha256-x99obZwqDAhUB+VUhAV9sKH00NnsVi481n/8bdvZCUY=",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "soonix",
|
||||
"rev": "add807ef8980197bbd06652a36d937b93b2a31c7",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "TECHNOFAB",
|
||||
"repo": "soonix",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
inputs = {
|
||||
nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib";
|
||||
nixmkdocs.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib";
|
||||
soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib";
|
||||
nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.0.0-alpha.2?dir=lib";
|
||||
treefmt-nix = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
flake = false;
|
||||
|
|
@ -12,6 +14,8 @@
|
|||
// {
|
||||
ntlib = i.nixtest-lib.lib {inherit (i.parent) pkgs;};
|
||||
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;};
|
||||
devshell = import "${i.parent.self}/lib" {inherit (i.parent) pkgs;};
|
||||
treefmt = import i.treefmt-nix;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue