This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtullia.nix
104 lines (89 loc) · 2.64 KB
/
tullia.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{inputs, ...}: {
imports = with inputs; [
tullia.flakePartsModules.default
];
perSystem = {inputs', ...}: {
tullia = let
ciInputName = "GitHub Push or PR";
repository = "input-output-hk/cicero";
in {
tasks = let
common = {
config,
lib,
...
}: {
preset = {
nix.enable = true;
github.ci = __mapAttrs (_: lib.mkDefault) {
enable = config.actionRun.facts != {};
inherit repository;
remote = config.preset.github.lib.readRepository ciInputName "";
revision = config.preset.github.lib.readRevision ciInputName "";
};
};
nomad.driver = "exec";
};
in {
lint = {...}: {
imports = [common];
config = {
command.text = ''
nix develop -L -c lint
'';
memory = 1024 * 2;
nomad.resources.cpu = 1000;
};
};
build = {config, ...}: {
imports = [common];
config = {
after = ["lint"];
command.text = config.preset.github.status.lib.reportBulk {
bulk.text = "nix eval .#packages --apply __attrNames --json | nix-systems -i";
each.text = ''
for package in \
cicero \
cicero-evaluator-nix \
webhook-trigger
do
nix build -L .#packages."$1"."$package"
readarray -t tests < <(
nix eval .#packages."$1"."$package".passthru.tests --apply __attrNames --json |
jq --raw-output .[]
)
installables=()
for test in "''${tests[@]}"; do
installables+=(.#packages."$1"."$package".passthru.tests."$test")
done
if [[ ''${#installables[@]} -gt 0 ]]; then
nix build -L "''${installables[@]}"
fi
done
'';
};
env.NIX_CONFIG = ''
extra-system-features = kvm
'';
memory = 1024 * 3;
nomad.resources.cpu = 3500;
};
};
};
actions."cicero/ci" = {
task = "build";
io = ''
let github = {
#input: "${ciInputName}"
#repo: "${repository}"
}
#lib.merge
#ios: [
#lib.io.github_push & github & {#default_branch: true},
#lib.io.github_pr & github,
]
'';
};
};
};
}