@@ -9,11 +9,15 @@ on: pull_request
9# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_call
9# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_call
10# https://docs.github.com/en/actions/learn-github-actions/contexts#about-contexts-and-expressions
10# https://docs.github.com/en/actions/learn-github-actions/contexts#about-contexts-and-expressions
12+# You can override the default DIFF_CUTOFF_PERCENT by specifying a cutoff along
13+# with the benchmark target.
14+# Eg, "Data.Async:12" where "Data.Async" is the benchmark target, ":" is the
15+# seperator, and "12" is the new cutoff percent
13 check-regressions:
17 check-regressions:
15 BENCH_SH: bin/bench.sh
19 BENCH_SH: bin/bench.sh
16− BENCHMARKS: >-
20+ BENCHMARKS_WITH_CUTOFF: >-
17 Data.Array
21 Data.Array
18 Data.Array.Foreign
22 Data.Array.Foreign
19 Data.Array.Prim
23 Data.Array.Prim
@@ -25,14 +29,14 @@ jobs:
25 Data.SmallArray
29 Data.SmallArray
26 Data.Stream.StreamD
30 Data.Stream.StreamD
27 Data.Stream.StreamDK
31 Data.Stream.StreamDK
28− Data.Stream.StreamK
32+ Data.Stream.StreamK:6
29 Data.Unfold
33 Data.Unfold
30 FileSystem.Handle
34 FileSystem.Handle
31 Prelude.Ahead
35 Prelude.Ahead
32− Prelude.Async
36+ Prelude.Async:12
33 Prelude.Parallel
37 Prelude.Parallel
34 Prelude.Serial
38 Prelude.Serial
35− Prelude.WAsync
39+ Prelude.WAsync:6
36 Prelude.WSerial
40 Prelude.WSerial
37 Prelude.ZipAsync
41 Prelude.ZipAsync
38 Prelude.ZipSerial
42 Prelude.ZipSerial
@@ -46,6 +50,16 @@ jobs:
53+ - name: Update environment
56+ for i in $BENCHMARKS_WITH_CUTOFF
58+ bname=$(echo "$i" | cut -d: -f1)
59+ BENCHMARKS="$BENCHMARKS $bname"
61+ echo "BENCHMARKS=$BENCHMARKS" >> $GITHUB_ENV
49 - name: Setup haskell
63 - name: Setup haskell
50 uses: actions/setup-haskell@v1
64 uses: actions/setup-haskell@v1
@@ -113,9 +127,27 @@ jobs:
113 - name: Compare benchmarks
127 - name: Compare benchmarks
115 chmod +x $BENCH_SH
129 chmod +x $BENCH_SH
133+ for i in $BENCHMARKS_WITH_CUTOFF
140+ test -z "$cutoff" && cutoff=$DIFF_CUTOFF_PERCENT
143+ echo "Checking $bname for regressions greater than $cutoff percent"
116− ! $BENCH_SH --benchmarks "$BENCHMARKS" \
144+ ! $BENCH_SH --benchmarks "$bname" \
117− --fields "$FIELDS" \
145+ --fields "$FIELDS" \
118− --no-measure \
146+ --no-measure \
119− --silent --append \
147+ --silent --append \
120− --diff-cutoff-percent $DIFF_CUTOFF_PERCENT \
148+ --diff-cutoff-percent $cutoff \
121− | grep -v "^$"
149+ | grep -v "^$"
150+ test $? -eq 1 && EXIT_STATUS=1