forked from reflex-frp/reflex-dom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobsets.nix
70 lines (69 loc) · 1.92 KB
/
jobsets.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
{ prs }:
let
pkgs = (import ./reflex-platform.nix {}).nixpkgs;
mkFetchGithub = value: {
inherit value;
type = "git";
emailresponsible = false;
};
in
with pkgs.lib;
let
defaults = jobs: {
inherit (jobs) description;
enabled = 1;
hidden = false;
keepnr = 10;
schedulingshares = 100;
checkinterval = 120;
enableemail = false;
emailoverride = "";
nixexprinput = "reflex-dom";
nixexprpath = "release.nix";
inputs = jobs.inputs // {
nixpkgs = {
type = "git";
value = "https://github.com/NixOS/nixpkgs-channels nixos-unstable";
emailresponsible = false;
};
config = {
type = "nix";
value = "{ android_sdk.accept_license = true; }";
emailresponsible = false;
};
};
};
branchJobset = branch: defaults {
description = "reflex-dom-${branch}";
inputs = {
reflex-dom = {
value = "https://github.com/reflex-frp/reflex-dom ${branch}";
type = "git";
emailresponsible = false;
};
};
};
makePr = num: info: {
name = "reflex-dom-pr-${num}";
value = defaults {
description = "#${num}: ${info.title}";
inputs = {
reflex-dom = {
#NOTE: This should really use "pull/${num}/merge"; however, GitHub's
#status checks only operate on PR heads. This creates a race
#condition, which can currently only be solved by requiring PRs to be
#up to date before they're merged. See
#https://github.com/isaacs/github/issues/1002
value = "https://github.com/reflex-frp/reflex-dom pull/${num}/head";
type = "git";
emailresponsible = false;
};
};
};
};
processedPrs = mapAttrs' makePr (builtins.fromJSON (builtins.readFile prs));
jobsetsAttrs = processedPrs //
genAttrs ["develop"] branchJobset;
in {
jobsets = pkgs.writeText "spec.json" (builtins.toJSON jobsetsAttrs);
}