-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,52 @@ | ||
# Automatically bumps the torch-mlir submodule to the latest commit on the main branch. | ||
# Runs on a schedule (Sunday and Thursday at 00:00) or can be manually triggered. | ||
|
||
name: Bump Submodule | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0,4' # Run at 00:00 on Sunday and Thursday | ||
pull_request: | ||
branches: ["main"] | ||
paths: | ||
- ".github/workflows/bump_submodules.yml" | ||
# TODO: Uncomment the following lines to enable the schedule when this action is stable & useful enough | ||
# schedule: | ||
# - cron: '0 0 * * 0,4' # Run at 00:00 on Sunday and Thursday | ||
workflow_dispatch: | ||
|
||
jobs: | ||
bump_submodule: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
with: | ||
submodules: true | ||
|
||
- name: Bump torch-mlir submodule | ||
id: bump_submodule | ||
run: | | ||
cd third_party/torch-mlir | ||
git fetch origin | ||
git checkout origin/main | ||
torch_mlir_commit=$(git rev-parse HEAD) | ||
TORCH_MLIR_COMMIT=$(git rev-parse HEAD) | ||
cd ../.. | ||
git add third_party/torch-mlir | ||
git commit -m "Bump torch-mlir submodule to latest version" | ||
git push | ||
echo "torch_mlir_commit=$torch_mlir_commit" >> $GITHUB_OUTPUT | ||
git commit -m "Bump torch-mlir submodule to $TORCH_MLIR_COMMIT" | ||
- name: Setting git config | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Submodule Bump Action" | ||
- name: Push changes | ||
run: git push | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.0 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: bump-torch-mlir-submodule | ||
title: 'Bump torch-mlir submodule to latest version' | ||
branch: bump-torch-mlir-submodule-${{ github.run_id }} | ||
title: 'Bump torch-mlir submodule to ${{ steps.bump_submodule.outputs.TORCH_MLIR_COMMIT }}' | ||
body: | | ||
This PR updates the torch-mlir submodule to the latest version available. | ||
Bumped to commit: https://github.com/shark-infra/torch-mlir/commit/${{ steps.bump_submodule.outputs.torch_mlir_commit }} | ||
This PR updates the torch-mlir submodule to commit ${{ steps.bump_submodule.outputs.TORCH_MLIR_COMMIT }}. | ||
Auto-generated by GitHub Actions. | ||
commit-message: 'Bump torch-mlir submodule to latest version' | ||
labels: automated-pr | ||
commit-message: 'Bump torch-mlir submodule to ${{ steps.bump_submodule.outputs.TORCH_MLIR_COMMIT }}' | ||
labels: automated-pr | ||