summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-08-06 20:33:17 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-25 21:10:56 -0400
commit5b78e8658c3f5042967cbe9d30a5a630946c4fd7 (patch)
treedc30be11cb6f2f0ff30464932f77ec8d5f04a235
parentdd6640316865d84075b00013b8b97076705e5c44 (diff)
downloadhaskell-5b78e8658c3f5042967cbe9d30a5a630946c4fd7.tar.gz
ci: Add ad-hoc performance testing rule
-rw-r--r--.gitlab-ci.yml35
-rwxr-xr-x.gitlab/ci.sh29
2 files changed, 64 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b0792f403c..2e925708e1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1096,6 +1096,41 @@ perf-nofib:
- nofib.log
############################################################
+# Ad-hoc performance testing
+############################################################
+
+perf:
+ stage: testing
+ dependencies:
+ - validate-x86_64-linux-deb9-dwarf
+ image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
+ rules:
+ - if: $CI_MERGE_REQUEST_ID
+ - if: '$CI_COMMIT_BRANCH == "master"'
+ - if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
+ tags:
+ - x86_64-linux-perf
+ script:
+ - root=$(pwd)/ghc
+ - |
+ mkdir tmp
+ tar -xf ghc-x86_64-deb9-linux-dwarf.tar.xz -C tmp
+ pushd tmp/ghc-*/
+ ./configure --prefix=$root
+ make install
+ popd
+ rm -Rf tmp
+ - export BOOT_HC=$(which ghc)
+ - export HC=$root/bin/ghc
+ - .gitlab/ci.sh perf_test
+ artifacts:
+ expire_in: 12 week
+ when: always
+ paths:
+ - out
+
+
+############################################################
# Documentation deployment via GitLab Pages
############################################################
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index c28755ecb8..00471115e4 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -395,6 +395,34 @@ function test_hadrian() {
--test-compiler="$TOP"/_build/install/bin/ghc
}
+function cabal_test() {
+ if [ -z "$OUT" ]; then
+ fail "OUT not set"
+ fi
+
+ start_section "Cabal test: $OUT"
+ mkdir -p "$OUT"
+ run "$HC" \
+ -hidir tmp -odir tmp -fforce-recomp \
+ -ddump-to-file -dumpdir "$OUT/dumps" -ddump-timings \
+ +RTS --machine-readable "-t$OUT/rts.log" -RTS \
+ -package mtl -ilibraries/Cabal/Cabal libraries/Cabal/Cabal/Setup.hs \
+ $@
+ rm -Rf tmp
+ end_section "Cabal test: $OUT"
+}
+
+function run_perf_test() {
+ if [ -z "$HC" ]; then
+ fail "HC not set"
+ fi
+
+ mkdir -p out
+ OUT=out/Cabal-O0 cabal_test -O0
+ OUT=out/Cabal-O1 cabal_test -O1
+ OUT=out/Cabal-O2 cabal_test -O2
+}
+
function clean() {
rm -R tmp
run "$MAKE" --quiet clean || true
@@ -465,6 +493,7 @@ case $1 in
push_perf_notes
exit $res ;;
run_hadrian) run_hadrian $@ ;;
+ perf_test) run_perf_test ;;
clean) clean ;;
shell) shell $@ ;;
*) fail "unknown mode $1" ;;