Anirban166 / Autocomment-atime-results

GitHub Action that automatically comments a plot and other atime-based results on PRs
https://github.com/marketplace/actions/autocomment-atime-results
0 stars 1 forks source link

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:

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.

Usage

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: