forked from IntersectMBO/plutus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
53 lines (51 loc) · 2 KB
/
release.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
let
fixedLib = import ./lib.nix { };
fixedNixpkgs = fixedLib.nixpkgs;
in
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
, scrubJobs ? true
, fasterBuild ? false
, skipPackages ? []
, nixpkgsArgs ? {
config = { allowUnfree = false; inHydra = true; };
inherit fasterBuild;
}
}:
with (import (fixedNixpkgs + "/pkgs/top-level/release-lib.nix") {
inherit supportedSystems scrubJobs nixpkgsArgs;
packageSet = import ./.;
});
let
plutusPkgs = import ./. { };
pkgs = import fixedNixpkgs { };
haskellPackages = map (name: lib.nameValuePair name supportedSystems) fixedLib.plutusPkgList;
# don't need to build the docs on anything other than one platform
docs = map (name: lib.nameValuePair name [ "x86_64-linux" ]) (builtins.attrNames plutusPkgs.docs);
platforms = {
inherit haskellPackages;
inherit docs;
};
mapped = mapTestOn platforms;
makePlutusTestRuns = system:
let
pred = name: value: fixedLib.isPlutus name;
plutusPkgs = import ./. { inherit system; };
# for things which are split-check then take the test run, otherwise
# use the main derivation which will have the tests as part of it
f = name: value: if value ? testdata then value.testrun else value;
in pkgs.lib.mapAttrs f (lib.filterAttrs pred plutusPkgs.haskellPackages);
in pkgs.lib.fix (jobsets: mapped // {
inherit (plutusPkgs) tests docs plutus-playground;
all-plutus-tests = builtins.listToAttrs (map (arch: { name = arch; value = makePlutusTestRuns arch; }) supportedSystems);
required = pkgs.lib.hydraJob (pkgs.releaseTools.aggregate {
name = "plutus-required-checks";
constituents =
let
allLinux = x: map (system: x.${system}) [ "x86_64-linux" ];
all = x: map (system: x.${system}) supportedSystems;
in
[
(builtins.concatLists (map lib.attrValues (all jobsets.all-plutus-tests)))
] ++ (builtins.attrValues jobsets.tests) ++ (builtins.attrValues jobsets.docs) ++ [jobsets.plutus-playground.client];
});
})