forked from IntersectMBO/plutus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.nix
38 lines (38 loc) · 2.13 KB
/
ci.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
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluting
# on a machine with e.g. no way to build the Darwin IFDs you need!
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
# This will be used by the packages that get the git revision in lieu of actually trying to find it,
# which doesn't work in all situations. Set to null to get it from git.
, rev ? "fake"
}:
let
inherit (import ./nix/ci-lib.nix) dimension platformFilterGeneric filterAttrsOnlyRecursive;
systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
# I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
linux = "x86_64-linux";
darwin = "x86_64-darwin";
};
sources = import ./nix/sources.nix;
# Useful for generic library functions: do not use for anything platform dependent
genericPkgs = import sources.nixpkgs {};
in dimension "System" (systems genericPkgs) (systemName: system:
let
packageSet = import ./default.nix { inherit system rev; checkMaterialization = true; };
pkgs = packageSet.pkgs;
lib = pkgs.lib;
platformFilter = platformFilterGeneric pkgs system;
in filterAttrsOnlyRecursive (_: v: platformFilter v) {
inherit (packageSet) docs papers dev tests plutus-playground marlowe-playground plutus-scb marlowe-symbolic-lambda;
haskell =
let
# These functions pull out from the Haskell package set either all the components of a particular type, or
# all the checks.
collectChecks = _: ps: pkgs.recurseIntoAttrs (builtins.mapAttrs (_: p: p.checks) ps);
collectComponents = type: ps: packageSet.pkgs.haskell-nix.haskellLib.collectComponents' type ps;
# This computes the Haskell package set sliced by component type
in pkgs.recurseIntoAttrs (dimension
"Haskell component"
{"library" = collectComponents; "tests" = collectComponents; "benchmarks" = collectComponents; "exes" = collectComponents; "checks" = collectChecks;}
# Apply the selector to the Haskell package set
(type: selector: (selector type) packageSet.haskell.projectPackages));
})