Skip to content

Commit

Permalink
Set up a simple CI profiling step using nixprof
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka committed Feb 15, 2023
1 parent 4952abb commit 2991480
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,10 @@ jobs:
- uses: actions/checkout@v3
- name: "nix-tools build"
run: cd ./nix-tools && .buildkite/nix-tools-build.sh

nixprof:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
- name: "Run tests with ghc8107: Profile flakes development shell ..."
run: nix shell github:yvan-sraka/nixprof -c ./test/tests.sh ghc8107 nixprof
14 changes: 14 additions & 0 deletions test/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,18 @@ if [ "$TESTS" == "docs" ] || [ "$TESTS" == "all" ]; then
popd
fi

if [ "$TESTS" == "nixprof" ]; then
printf "*** Profile flakes development shell ...\n" >& 2
nixprof record nix build $NIX_BUILD_ARGS \
--accept-flake-config \
-I . -I .. \
--option restrict-eval true \
--option allowed-uris "https://github.com/NixOS https://github.com/input-output-hk" \
--no-link --keep-going -f default.nix \
--argstr compiler-nix-name $GHC \
--arg CADerivationsEnabled $NIX_CA_DERIVATIONS
nixprof report
echo >& 2
fi

printf "\n*** Finished successfully\n" >& 2

0 comments on commit 2991480

Please sign in to comment.