From e094bdcd62201f0690c384bc4577ae8bede761d3 Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Sat, 21 Nov 2020 14:28:32 +0100 Subject: [PATCH] chore: Nix: print cumulative and per-line execution time on CI --- .github/workflows/nix-ci.yml | 3 ++- flake.nix | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index a8a6c08e7b..3b8c4fc432 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -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: diff --git a/flake.nix b/flake.nix index 023488d79c..6efd45579c 100644 --- a/flake.nix +++ b/flake.nix @@ -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;