···11+% Generated by roxygen2: do not edit by hand
22+% Please edit documentation in R/bootstrapper.R
33+\name{setup_touchstone}
44+\alias{setup_touchstone}
55+\title{Configure Touchstone}
66+\usage{
77+setup_touchstone()
88+}
99+\value{
1010+Invisibly returns \code{NULL}.
1111+}
1212+\description{
1313+Write a modified Touchstone GHA to benchmark PRs. You still
1414+need to write an appropriate \code{script.R} for the actual
1515+benchmarks. This version of the touchstone commenting GHA
1616+updates a single comment instead of making multiple, and also
1717+adds the touchstone plots in a dropdown. These are stored on a new
1818+branch.
1919+}
···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
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
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()