From 1d29a75a6aa14c58404bea4643384adae599983f Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:26:54 +0200 Subject: [PATCH] Add Slow CI reminder bot (#33506) * add workflow * update * fix * Update .github/workflows/slow_ci_remainder.yml Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * fix * fix --------- Co-authored-by: ydshieh Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> --- .github/workflows/slow_ci_remainder.yml | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/slow_ci_remainder.yml diff --git a/.github/workflows/slow_ci_remainder.yml b/.github/workflows/slow_ci_remainder.yml new file mode 100644 index 00000000000000..b2d1a49f658f24 --- /dev/null +++ b/.github/workflows/slow_ci_remainder.yml @@ -0,0 +1,63 @@ +name: Slow CI Reminder + +# For security reason, don't use `pull_request` but `pull_request_target`! +on: + pull_request_target: + paths: + - "src/transformers/models/*/*.py" + - "src/transformers/generation/*.py" + - "src/transformers/pipelines/*.py" + - "tests/models/*/*.py" + - "tests/generation/*/*.py" + - "tests/pipelines/*/*.py" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + remind: + name: remind + runs-on: ubuntu-22.04 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Find comment + uses: peter-evans/find-comment@v2 + id: find_comment + with: + issue-number: ${{ github.event.number }} + body-includes: Before merging this pull request, slow tests CI should be triggered. To enable this + + - run: | + echo ${{ steps.find_comment.outputs.comment-id }} + + - name: Delete previous comment (if found) + if: steps.find_comment.outputs.comment-id != '' + uses: actions/github-script@v6 + with: + result-encoding: string + github-token: ${{ secrets.comment_bot_token }} + script: | + github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{ steps.find_comment.outputs.comment-id }}, + }) + + - name: Add comment + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + Hey! 🤗 Thanks for your contribution to the `transformers` library! + + Before merging this pull request, slow tests CI should be triggered. To enable this: + - Add the `run-slow` label to the PR + - When your PR is ready for merge and all reviewers' comments have been addressed, push an empty commit with the command `[run-slow]` followed by a comma separated list of all the models to be tested, i.e. `[run_slow] model_to_test_1, model_to_test_2` + - If the pull request affects a lot of models, put at most 10 models in the commit message + - A `transformers` maintainer will then approve the workflow to start the tests + + (For maintainers) The documentation for slow tests CI on PRs is [here](https://www.notion.so/huggingface2/CI-for-pull-requests-8335bd9217d24d1e8ed1d3a016f39804). + + pr_number: ${{ github.event.number }} + GITHUB_TOKEN: ${{ secrets.comment_bot_token }}