chore: Nix: print cumulative and per-line execution time on CI

This commit is contained in:
Sebastian Ullrich 2020-11-21 14:28:32 +01:00
parent 4061894943
commit e094bdcd62
2 changed files with 8 additions and 1 deletions

View file

@ -14,7 +14,8 @@ jobs:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: nix --experimental-features "nix-command flakes" shell .#nix -c bash -euo pipefail {0}
# Can't use `nix-shell` without configured nixpkgs path on macOS
shell: nix -v --experimental-features "nix-command flakes" run .#ciShell -- bash -euxo pipefail {0}
strategy:
matrix:
include:

View file

@ -58,6 +58,12 @@
temci = (import temci {}).override { doCheck = false; };
nix = nix-pinned;
nixpkgs = nixpkgs.legacyPackages.${system};
ciShell = writeShellScriptBin "ciShell" ''
set -o pipefail
export PATH=${nix-pinned}/bin:${moreutils}/bin:$PATH
# prefix lines with cumulative and individual execution time
"$@" |& ts -i "(%.S)]" | ts -s "[%M:%S"
'';
};
defaultPackage = packages.lean;