Add hydra configuration

This commit is contained in:
Luigy Leon 2019-01-16 14:12:07 -05:00
parent 54aa3c3296
commit 1a7da68f2c
3 changed files with 114 additions and 0 deletions

29
hydra.json Normal file
View File

@ -0,0 +1,29 @@
{
"enabled": 1,
"hidden": true,
"description": "Jobsets",
"nixexprinput": "src",
"nixexprpath": "jobsets.nix",
"checkinterval": 300,
"schedulingshares": 100,
"enableemail": false,
"emailoverride": "",
"keepnr": 10,
"inputs": {
"src": {
"type": "git",
"value": "https://github.com/reflex-frp/reflex.git develop",
"emailresponsible": false
},
"nixpkgs": {
"type": "git",
"value": "https://github.com/NixOS/nixpkgs-channels nixos-unstable",
"emailresponsible": false
},
"prs": {
"type": "githubpulls",
"value": "reflex-frp reflex",
"emailresponsible": false
}
}
}

70
jobsets.json Normal file
View File

@ -0,0 +1,70 @@
{ prs }:
let
pkgs = import ./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";
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-${branch}";
inputs = {
reflex = {
value = "https://github.com/reflex-frp/reflex ${branch}";
type = "git";
emailresponsible = false;
};
};
};
makePr = num: info: {
name = "reflex-pr-${num}";
value = defaults {
description = "#${num}: ${info.title}";
inputs = {
reflex = {
#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 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);
}

15
release.nix Normal file
View File

@ -0,0 +1,15 @@
{ rp-src ? (import <nixpkgs> {}).fetchFromGitHub {
owner = "reflex-frp";
repo = "reflex-platform";
rev = "384cd850f3adf1d404bced2424b5f6efb0f415f2";
sha256 = "1ws77prqx8khmp8j6br1ij4k2v4dlgv170r9fmg0p1jivfbn8y9d";
}
}:
let
rp = import rp-src {};
inherit (rp.nixpkgs) lib;
compilers = ["ghc8_4" "ghc8_0" "ghcjs8_4" "ghcjs8_0"];
in lib.genAttrs compilers (ghc: {
reflex-useTemplateHaskell = rp.${ghc}.callPackage ./. { useTemplateHaskell = true; };
reflex = rp.${ghc}.callPackage ./. { useTemplateHaskell = false; };
})