2
0
Fork 0

Add Hydra spec for Solo5 pull requests

This commit is contained in:
Ehmry - 2019-10-21 13:06:35 +02:00
parent c1acd31f76
commit e3589e5a41
7 changed files with 102 additions and 7 deletions

View File

@ -13,7 +13,7 @@ let
nic_bus = callPackage ./pkgs/nic_bus { };
});
nova = callPackage ./NOVA { };
solo5 = callPackage ./solo5 { };
solo5 = callPackage ./pkgs/solo5 { };
};
toolchainOverlay = import ./toolchain-overlay;

View File

@ -1,13 +1,13 @@
{
"enabled": 1,
"hidden": false,
"description": "Genode packages collection",
"hidden": true,
"description": ".jobsets",
"nixexprinput": "genodepkgs",
"nixexprpath": "hydra/jobsets.nix",
"checkinterval": 300,
"schedulingshares": 100,
"enableemail": false,
"emailoverride": "",
"emailoverride": "ehmry@posteo.net",
"keepnr": 3,
"inputs": {
"genodepkgs": {
@ -19,6 +19,11 @@
"type": "git",
"value": "https://gitea.c3d2.de/ehmry/nixpkgs.git hybrid-19.09",
"emailresponsible": false
},
"solo5PullRequests": {
"type": "githubpulls",
"value": "solo5 solo5",
"emailresponsible": false
}
}
}

View File

@ -1,5 +1,6 @@
{ genodepkgs ? ../default.nix
, nixpkgs ? import ../nixpkgs.nix
, solo5PullRequests
}:
let
@ -17,7 +18,9 @@ let
keepnr = 8;
};
jobsets = {
solo5 = import ./solo5-jobs.nix { pullRequests = solo5PullRequests; };
jobsets = ({
trunk = mkJobSet {
description = "Genodepkgs master branch";
@ -65,6 +68,6 @@ let
};
};
};
} // solo5);
in { jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets); }

61
hydra/solo5-jobs.nix Normal file
View File

@ -0,0 +1,61 @@
# SPDX-FileCopyrightText: Emery Hemingway
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ pullRequests }:
with builtins;
let
pullRequests' = fromJSON (readFile pullRequests);
prToJob = pr:
{
name = "solo5-${toString pr.number}";
value = {
description = pr.title;
nixexprpath = "hydra/solo5.nix";
enabled = 1;
hidden = false;
nixexprinput = "genodepkgs";
checkinterval = 300;
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 8;
inputs = {
prSrc = {
type = "git";
value = "${pr.head.repo.clone_url} ${pr.head.ref}";
emailresponsible = false;
};
genodepkgs = {
type = "git";
value = "https://gitea.c3d2.de/ehmry/genodepkgs.git master";
emailresponsible = false;
};
nixpkgs = {
type = "git";
value = "https://gitea.c3d2.de/ehmry/nixpkgs.git hybrid-19.09";
emailresponsible = false;
};
nim-overlay = {
type = "git";
value = "https://git.sr.ht/~ehmry/nim-overlay";
emailresponsible = false;
};
};
};
};
jobs = map prToJob (attrValues pullRequests');
in listToAttrs jobs

20
hydra/solo5.nix Normal file
View File

@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: Emery Hemingway
#
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
{ genodepkgs, nixpkgs, nim-overlay, prSrc }:
let pkgs = import genodepkgs { inherit nixpkgs nim-overlay; };
in {
build.x86_64.solo5 = pkgs.solo5.overrideAttrs (attrs: {
src = prSrc;
preeConfigure = ''
cat <<EOM >include/solo5/solo5_version.h.distrib
#ifndef __VERSION_H__
#define __VERSION_H__
#define SOLO5_VERSION "pull-request-test"
#endif
EOM
'';
});
}

View File

@ -20,14 +20,20 @@ in stdenv.mkDerivation {
enableParallelBuilding = true;
configurePhase = "HOSTCC=${buildPackages.stdenv.cc}/bin/cc sh configure.sh";
configurePhase = ''
runHook preConfigure
HOSTCC=${buildPackages.stdenv.cc}/bin/cc sh configure.sh
runHook postConfigure
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $tests/bin
make install-opam-genode PREFIX=$out
for test in tests/*/*.genode; do
cp $test $tests/bin/solo5-`basename $test .genode`
done
runHook postInstall
'';
meta = with stdenv.lib; {