Skip to content

Commit

Permalink
Preparation for using Hydra for CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
dalaing committed Jul 19, 2017
1 parent bb35ff2 commit ecc8008
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 96 deletions.
79 changes: 0 additions & 79 deletions .travis.yml

This file was deleted.

30 changes: 30 additions & 0 deletions ci/ci.nix
@@ -0,0 +1,30 @@
{ supportedSystems ? ["x86_64-linux"]
, supportedCompilers ? ["ghc7103" "ghc802"]
}:

with (import <nixpkgs/pkgs/top-level/release-lib.nix> { inherit supportedSystems; });

let
pkgs = import <nixpkgs> {};

configurations =
pkgs.lib.listToAttrs (
pkgs.lib.concatMap (compiler:
pkgs.lib.concatMap (system:
[{name = "fp-course_" + compiler + "_" + system; value = {inherit compiler system;};}]
) supportedSystems
) supportedCompilers
);

jobs =
pkgs.lib.mapAttrs (name: configuration:
let
compiler = configuration.compiler;
system = configuration.system;
nixpkgs = { pkgs = pkgsFor system; };
course = import ../default.nix { inherit nixpkgs compiler; };
in
course
) configurations;
in
jobs
16 changes: 16 additions & 0 deletions ci/jobsets.json
@@ -0,0 +1,16 @@
{
"enabled": 1,
"hidden": false,
"description": "jobsets",
"nixexprinput": "fp-course",
"nixexprpath": "ci/jobsets.nix",
"checkinterval": 300,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 5,
"inputs": {
"fp-course": { "type": "git", "value": "https://github.com/data61/fp-course.git master", "emailresponsible": false },
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git release-17.03", "emailresponsible": false }
}
}
27 changes: 27 additions & 0 deletions ci/jobsets.nix
@@ -0,0 +1,27 @@
{ nixpkgs, declInput }: let pkgs = import nixpkgs {}; in {
jobsets = pkgs.runCommand "spec.json" {} ''
cat <<EOF
${builtins.toXML declInput}
EOF
cat > $out <<EOF
{
"fp-course": {
"enabled": 1,
"hidden": false,
"description": "FP Course",
"nixexprinput": "fp-course",
"nixexprpath": "./ci/ci.nix",
"checkinterval": 300,
"schedulingshares": 1,
"enableemail": false,
"emailoverride": "",
"keepnr": 5,
"inputs": {
"fp-course": { "type": "git", "value": "https://github.com/data61/fp-course.git master", "emailresponsible": false },
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git release-17.03", "emailresponsible": false }
}
}
}
EOF
'';
}
23 changes: 23 additions & 0 deletions default.nix
@@ -0,0 +1,23 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:

let
inherit (nixpkgs) pkgs;

haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};

modifiedHaskellPackages = haskellPackages.override {
overrides = self: super: {
tasty-discover = pkgs.haskell.lib.dontCheck super.tasty-discover_3_0_2;
};
};

fp-course = modifiedHaskellPackages.callPackage ./fp-course.nix {};
# Dodgy fun times, make sure that
# - the tests compile
# - the tests failing doesn't cause the build to fail
modified-fp-course = pkgs.haskell.lib.overrideCabal fp-course (drv: { checkPhase = "true"; });
in
modified-fp-course

20 changes: 3 additions & 17 deletions shell.nix
@@ -1,20 +1,6 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:

{ nixpkgs ? import <nixpkgs> {}}:
let
inherit (nixpkgs) pkgs;

haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};

modifiedHaskellPackages = haskellPackages.override {
overrides = self: super: {
tasty-discover = pkgs.haskell.lib.dontCheck super.tasty-discover_3_0_2;
};
};

drv = modifiedHaskellPackages.callPackage ./fp-course.nix {};

fp-course = import ./default.nix {};
in

if pkgs.lib.inNixShell then drv.env else drv
if pkgs.lib.inNixShell then fp-course.env else fp-course

0 comments on commit ecc8008

Please sign in to comment.