···11+# You can modify the PR comment footer here. You can use github markdown e.g.
22+# emojis like :tada:.
33+# This file will be parsed and evaluate within the context of
44+# `benchmark_analyze` and should return the comment text as the last value.
55+# See `?touchstone::pr_comment`
66+link <- "https://lorenzwalthert.github.io/touchstone/articles/inference.html"
77+glue::glue(
88+ "\nFurther explanation regarding interpretation and",
99+ " methodology can be found in the [documentation]({link})."
1010+)
+13
tests/testthat/touchstone/header.R
···11+# You can modify the PR comment header here. You can use github markdown e.g.
22+# emojis like :tada:.
33+# This file will be parsed and evaluate within the context of
44+# `benchmark_analyze` and should return the comment text as the last value.
55+# Available variables for glue substitution:
66+# * ci: confidence interval
77+# * branches: BASE and HEAD branches benchmarked against each other.
88+# See `?touchstone::pr_comment`
99+glue::glue(
1010+ "This is how benchmark results would change (along with a",
1111+ " {100 * ci}% confidence interval in relative change) if ",
1212+ "{system2('git', c('rev-parse', 'HEAD'), stdout = TRUE)} is merged into {branches[1]}:\n"
1313+)
+29
tests/testthat/touchstone/script.R
···11+# see `help(run_script, package = 'touchstone')` on how to run this
22+# interactively
33+44+# TODO OPTIONAL Add directories you want to be available in this file or during the
55+# benchmarks.
66+# touchstone::pin_assets("some/dir")
77+88+# installs branches to benchmark
99+touchstone::branch_install()
1010+1111+# benchmark a function call from your package (two calls per branch)
1212+touchstone::benchmark_run(
1313+ # expr_before_benchmark = source("dir/data.R"), #<-- TODO OTPIONAL setup before benchmark
1414+ random_test = yourpkg::f(), #<- TODO put the call you want to benchmark here
1515+ n = 2
1616+)
1717+1818+# TODO OPTIONAL benchmark any R expression (six calls per branch)
1919+# touchstone::benchmark_run(
2020+# more = {
2121+# if (TRUE) {
2222+# y <- yourpkg::f2(x = 3)
2323+# }
2424+# }, #<- TODO put the call you want to benchmark here
2525+# n = 6
2626+# )
2727+2828+# create artifacts used downstream in the GitHub Action
2929+touchstone::benchmark_analyze()