devtools/nix/repo/ci.nix

46 lines
1 KiB
Nix
Raw Normal View History

2025-09-17 11:59:53 +02:00
{inputs, ...}: let
inherit (inputs) cilib;
in
cilib.mkCI {
pipelines."default" = {
2025-09-17 12:53:35 +02:00
stages = ["test" "build" "deploy"];
2025-09-17 11:59:53 +02:00
jobs = {
2025-09-17 12:53:35 +02:00
"test" = {
stage = "test";
script = [
"nix run .#tests -- --junit=junit.xml"
];
allow_failure = true;
artifacts = {
when = "always";
reports.junit = "junit.xml";
};
};
2025-09-17 11:59:53 +02:00
"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";
}
];
};
};
};
}