@@ -0,0 +1,121 @@
1+name: Regression checking
7+# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
8+# https://docs.github.com/en/actions/using-workflows/reusing-workflows#reusable-workflows-and-starter-workflows
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
15+ BENCH_SH: bin/bench.sh
20+ Data.Array.Prim.Pinned
43+ DIFF_CUTOFF_PERCENT: 3
45+ runs-on: ubuntu-latest
49+ - name: Setup haskell
50+ uses: actions/setup-haskell@v1
55+ - uses: actions/cache@v2
56+ name: Cache ~/.cabal and bench-report
60+ ./benchmark/bench-report/bin/bench-report
61+ # Bump the key version to clear the cache
64+ - name: Cache charts from master
65+ id: cache-charts-master
66+ uses: actions/cache@v2
69+ # Bump the key version to clear the cache
70+ key: charts-master-v1
72+ # -----------------------------------------------------------------
73+ # -- Generate reports for the base branch and upload
74+ # -----------------------------------------------------------------
76+ - name: Checkout the base branch
77+ if: steps.cache-charts-master.outputs.cache-hit != 'true'
78+ uses: actions/checkout@v2
82+ - name: Run benchmarks
83+ if: steps.cache-charts-master.outputs.cache-hit != 'true'
86+ $BENCH_SH --benchmarks "$BENCHMARKS" --raw
88+ - name: Move charts to charts-master
89+ if: steps.cache-charts-master.outputs.cache-hit != 'true'
90+ run: mv charts charts-master
92+ # -----------------------------------------------------------------
93+ # -- Download, generate reports for the current branch and append
94+ # -----------------------------------------------------------------
96+ - name: Checkout the current branch
97+ uses: actions/checkout@v2
101+ - name: Copy charts-master to charts
102+ run: cp -r charts-master charts
104+ - name: Run benchmarks and append
107+ $BENCH_SH --benchmarks "$BENCHMARKS" --raw --append
109+ # -----------------------------------------------------------------
111+ # -----------------------------------------------------------------
113+ - name: Compare benchmarks
116+ ! $BENCH_SH --benchmarks "$BENCHMARKS" \
117+ --fields "$FIELDS" \
120+ --diff-cutoff-percent $DIFF_CUTOFF_PERCENT \