Skip to content

Commit

Permalink
Include benchmarks in CI by adding them to cabal.project
Browse files Browse the repository at this point in the history
Otherwise, they will get evicted from CI when CI is regenerated.
  • Loading branch information
andreasabel committed Mar 28, 2024
1 parent 1a12878 commit e825fb0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ jobs:
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/testsuite" >> cabal.project
if [ $((HCNUMVER >= 80000 && HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/bench" >> cabal.project ; fi
cat cabal.project
- name: sdist
run: |
Expand All @@ -254,21 +255,26 @@ jobs:
echo "PKGDIR_stm=${PKGDIR_stm}" >> "$GITHUB_ENV"
PKGDIR_testsuite="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/testsuite-[0-9.]*')"
echo "PKGDIR_testsuite=${PKGDIR_testsuite}" >> "$GITHUB_ENV"
PKGDIR_stm_bench="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/stm-bench-[0-9.]*')"
echo "PKGDIR_stm_bench=${PKGDIR_stm_bench}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_stm}" >> cabal.project
echo "packages: ${PKGDIR_testsuite}" >> cabal.project
if [ $((HCNUMVER >= 80000 && HCNUMVER < 91000)) -ne 0 ] ; then echo "packages: ${PKGDIR_stm_bench}" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package stm" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package testsuite" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200 && HCNUMVER < 91000)) -ne 0 ] ; then echo "package stm-bench" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200 && HCNUMVER < 91000)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(exceptions|filepath|stm|testsuite)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(exceptions|filepath|stm|stm-bench|testsuite)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down Expand Up @@ -296,6 +302,8 @@ jobs:
${CABAL} -vnormal check
cd ${PKGDIR_testsuite} || false
${CABAL} -vnormal check
if [ $((HCNUMVER >= 80000 && HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_stm_bench} || false ; fi
if [ $((HCNUMVER >= 80000 && HCNUMVER < 91000)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
Expand Down
16 changes: 14 additions & 2 deletions bench/stm-bench.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@ synopsis: External testsuite for stm package
category: Benchmarking
license: BSD-3-Clause
maintainer: [email protected]
tested-with: GHC==9.6.2, GHC==9.4.7, GHC==9.2.8, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2
description:
The benchmarks are in a separate project to avoid cyclic dependencies.

tested-with:
GHC == 9.8.2
GHC == 9.6.4
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
GHC == 8.8.4
GHC == 8.6.5
GHC == 8.4.4
GHC == 8.2.2
GHC == 8.0.2

benchmark chanbench
type: exitcode-stdio-1.0
main-is: ChanBench.hs
build-depends: base >= 4.9 && < 4.20, stm, async >= 2.0, tasty, tasty-bench
build-depends: base >= 4.9 && < 4.21, stm, async >= 2.0, tasty, tasty-bench
default-language: Haskell2010
ghc-options: -O2 -threaded -with-rtsopts=-N
5 changes: 4 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
packages: . testsuite/
packages: . testsuite/ bench/

package testsuite
tests: true

package stm-bench
benchmarks: true

0 comments on commit e825fb0

Please sign in to comment.