Allow empty regex, change name
`@github-actions benchmark` was too hard to remember
@@ -12,8 +12,7 @@ env:
jobs:
benchmarks:
name: "Run benchmarks"
- # TODO: Support more benchmarking options later, against different branches, against self, etc
- if: startsWith(github.event.comment.body, '@github-actions benchmark')
+ if: startsWith(github.event.comment.body, '@benchmark')
runs-on: ubuntu-latest
defaults:
run:
@@ -50,12 +49,17 @@ jobs:
run: |
# extracting the regex, see https://stackoverflow.com/a/36798723
REGEX=$(echo "$COMMENT" | sed -n "s/^.*-b\s*\(\S*\).*$/\1/p")
+ if [ -z "$REGEX" ]; then
+ BENCHMARKS=""
+ else
+ BENCHMARKS="--benchmarks $REGEX"
+ fi
cd benchmarks
asv check -E existing
git remote add upstream https://github.com/dedupeio/dedupe.git
git fetch upstream
asv machine --yes
- asv continuous -f 1.1 -b $REGEX upstream/main HEAD
+ asv continuous -f 1.1 $BENCHMARKS upstream/main HEAD
echo 'BENCH_OUTPUT<<EOF' >> $GITHUB_ENV
asv compare -f 1.1 upstream/main HEAD >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
@@ -74,5 +78,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
- body: '\nBenchmarks completed. View runner logs here.' + run_url + '\nRegex used: '+ 'regex ' + ENV_VARS["REGEX"] + '\n' + ENV_VARS["BENCH_OUTPUT"]
+ body: '\nBenchmarks completed. View runner logs here: ' + run_url + '\nRegex used: '+ 'regex ' + ENV_VARS["REGEX"] + '\n' + ENV_VARS["BENCH_OUTPUT"]
})
