-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.nix
38 lines (33 loc) · 1008 Bytes
/
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
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
nixpkgs = ../nixpkgs;
our_lilgit = (builtins.getFlake (toString ./.)).packages.${builtins.currentSystem}.default;
# override for bash_5
our_bats = bats.overrideAttrs ( old: rec {
buildInputs = [ bash_5 ];
});
in
stdenv.mkDerivation {
name = "lilgit-ci";
src = builtins.filterSource
(path: type:
type != "directory" || baseNameOf path
== "tests") ./.;
doCheck = true;
checkInputs = with pkgs; [ bash_5 gitAndTools.gitstatus git our_lilgit time our_bats unixtools.column ];
installPhase = ''
column -s, -t $out/timings
'';
LILGIT="${our_lilgit}/bin/lilgit.bash";
GITSTATUS="${gitAndTools.gitstatus}/share/gitstatus/gitstatus.plugin.sh";
NIXPKGS="${nixpkgs}";
checkPhase = ''
mkdir $out
patchShebangs .
cat tests/head_nixpkgs.bats tests/repo.bash > tests/ephemeral.bats
RUNS=1 bats tests/ephemeral.bats
RUNS=10 bats tests/ephemeral.bats
RUNS=100 bats tests/ephemeral.bats
'';
}