Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
wip
  • Loading branch information
nikic committed Oct 16, 2023
1 parent d430015 commit 681868f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/compile-time-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Compile Time Bot

on:
issue_comment:
types:
- created

jobs:
compile-time-bot:
if: >-
github.event.issue.pull_request &&
contains(github.event.comment.body, '@llvm-compile-time-bot test')
runs-on: ubuntu-latest
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Environment
run: |
pip install -r ./llvm/utils/git/requirements.txt
- name: Run Action
run: |
printf "%s" "$COMMENT_BODY" |
./llvm/utils/git/github-automation.py \
--repo "$GITHUB_REPOSITORY" \
compile-time-bot \
--pr-number ${{ github.event.issue.number }}
#--token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
12 changes: 12 additions & 0 deletions llvm/utils/git/github-automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,12 @@ def execute_command(self) -> bool:
print(sys.stdin.readlines())
return False

class CompileTimeBot:
def __init__(self, pr_number: int):
self.pr_numer = pr_number

def run(self) -> bool:
pass

parser = argparse.ArgumentParser()
parser.add_argument(
Expand Down Expand Up @@ -688,6 +694,9 @@ def execute_command(self) -> bool:
help="Set the default user and email for the git repo in LLVM_PROJECT_DIR to llvmbot",
)

compile_time_bot_parser = subparsers.add_parser("compile-time-bot")
compile_time_bot_parser.add_argument("--pr-number", type=int, required=True)

args = parser.parse_args()

if args.command == "issue-subscriber":
Expand Down Expand Up @@ -720,3 +729,6 @@ def execute_command(self) -> bool:
sys.exit(1)
elif args.command == "setup-llvmbot-git":
setup_llvmbot_git()
elif args.command == "compile-time-bots":
compile_time_bot = CompileTimeBot(args.pr_number)
compile_time_bot.run()

0 comments on commit 681868f

Please sign in to comment.