diff --git a/.github/workflows/touchstone-comment.yaml b/.github/workflows/touchstone-comment.yaml index ca14d073..ea5e392b 100644 --- a/.github/workflows/touchstone-comment.yaml +++ b/.github/workflows/touchstone-comment.yaml @@ -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 diff --git a/touchstone/script.R b/touchstone/script.R index 644259bb..8245a535 100644 --- a/touchstone/script.R +++ b/touchstone/script.R @@ -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" )) @@ -26,7 +24,7 @@ touchstone::benchmark_run( ) ) }, - n = 10 + n = 30 ) touchstone::benchmark_run( @@ -50,7 +48,7 @@ touchstone::benchmark_run( ) ) }, - n = 10 + n = 30 ) # create artifacts used downstream in the GitHub Action