Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions .github/workflows/touchstone-comment.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,46 @@
name: Continuous Benchmarks (Comment)

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
group: ${{ github.workflow }}-${{ github.run_id }}
cancel-in-progress: true

on:
workflow_run:
workflows: ["Continuous Benchmarks (Receive)"]
types:
- completed
types: [completed]

jobs:
upload:
comment:
runs-on: ubuntu-latest
permissions:
actions: read
pull-requests: write
statuses: write
if: >
${{ github.event.workflow_run.event == 'pull_request' }}
if: ${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- uses: lorenzwalthert/touchstone/actions/comment@main
- name: Download Touchstone artifact
id: download
uses: actions/download-artifact@v8
with:
name: pr
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ github.event.workflow_run.id }}

# defensive since issues could cause commenting in random places
- name: Read PR number
id: pr
shell: bash
run: |
number="$(tr -cd '0-9' < ./NR)"
test -n "$number"
echo "number=$number" >> "$GITHUB_OUTPUT"

- name: Create or update sticky PR comment
id: comment
uses: marocchino/sticky-pull-request-comment@v3
with:
GITHUB_TOKEN: ${{ github.token }}
number_force: ${{ steps.pr.outputs.number }}
header: touchstone
path: ./info.txt
skip_unchanged: true
8 changes: 3 additions & 5 deletions touchstone/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
# installs branches to benchmark
touchstone::branch_install()

# make log lik available to tests
touchstone::pin_assets("touchstone/wine.rds")

# These synthetic workloads are large enough to expose real slowdowns in the
# core `loo()` paths, but still short enough to keep PR feedback reasonably fast.
touchstone::benchmark_run(
expr_before_benchmark = {
suppressPackageStartupMessages(library(loo))
# benchmark_run() evaluates in a callr subprocess, so load pinned assets here.
wine_log_lik_matrix <- readRDS(touchstone::path_pinned_asset(
"touchstone/wine.rds"
))
Expand All @@ -26,7 +24,7 @@ touchstone::benchmark_run(
)
)
},
n = 10
n = 30
)

touchstone::benchmark_run(
Expand All @@ -50,7 +48,7 @@ touchstone::benchmark_run(
)
)
},
n = 10
n = 30
)

# create artifacts used downstream in the GitHub Action
Expand Down
Loading