From e825fb00a774d04fa0830f6f9cd69e6b736e5e79 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Thu, 28 Mar 2024 15:39:20 +0100 Subject: [PATCH] Include benchmarks in CI by adding them to cabal.project Otherwise, they will get evicted from CI when CI is regenerated. --- .github/workflows/haskell-ci.yml | 10 +++++++++- bench/stm-bench.cabal | 16 ++++++++++++++-- cabal.project | 5 ++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 1e131c9..4ae6b5b 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -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: | @@ -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 <> 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 @@ -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 diff --git a/bench/stm-bench.cabal b/bench/stm-bench.cabal index ac645af..3539487 100644 --- a/bench/stm-bench.cabal +++ b/bench/stm-bench.cabal @@ -6,13 +6,25 @@ synopsis: External testsuite for stm package category: Benchmarking license: BSD-3-Clause maintainer: libraries@haskell.org -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 diff --git a/cabal.project b/cabal.project index c343211..4007b2a 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,7 @@ -packages: . testsuite/ +packages: . testsuite/ bench/ package testsuite tests: true + +package stm-bench + benchmarks: true