A GitHub Action for R packages that runs atime::atime_pkg
and comments the generated results on pull requests to help identify potential performance regressions introduced from the incoming changes.
Contents of the comment consist of:
.ci/atime/tests.R
file within the respository. 1Versions include base (the target branch), HEAD (the PR/source branch), merge-base (their common ancestor), and CRAN (yup, your package needs to be there :).atime
-generated results.To avoid flooding the pull request on every push to it, only one comment will exist in the PR thread at all times. After the initial comment generated from the first commit on the pull request branch, subsequent pushes will simply update the comment's body.
For any GitHub repository of an R package, one can use this template:
name: Autocomment atime-based performance regression analysis on PRs
on:
pull_request:
branches:
- '*'
types:
- opened
- reopened
- synchronize
jobs:
comment:
runs-on: ubuntu-latest
container: ghcr.io/iterative/cml:0-dvc2-base1
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: Anirban166/Autocomment-atime-results@v1.3.1
Emplace the contents in .github/workflows/<workflowName>.yml
. The example I provided above can be customized further as needed, as long as a few things are kept intact:
pull_request
eventGITHUB_PAT
is supplied (required to authenticate git operations, have higher rate limits, etc.)container
and repo_token
fields are specified as I did above (required for cml
functionality)