-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #595 from mlcommons/mlperf-inference
Sync <- Mlperf inference
- Loading branch information
Showing
7 changed files
with
2,711 additions
and
1,688 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Automatic code formatting | ||
name: "format" | ||
on: | ||
push: | ||
branches: [ "main", "mlperf-inference" ] | ||
|
||
env: | ||
python_version: "3.9" | ||
|
||
jobs: | ||
format-code: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ssh-key: ${{ secrets.DEPLOY_KEY }} | ||
- name: Set up Python ${{ env.python_version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ env.python_version }} | ||
|
||
- name: Format modified python files | ||
run: | | ||
python3 -m pip install autopep8 | ||
for FILE in $(git diff --name-only ${{ github.event.before }} | grep -E '.*\.py$') | ||
do | ||
autopep8 --in-place -a $FILE | ||
git add $FILE | ||
done | ||
- name: Format modified C++ files | ||
run: | | ||
for FILE in $(git diff --name-only ${{ github.event.before }} | grep -E '.*\.(cc|cpp|h|hpp)$') | ||
do | ||
clang-format -i -style=file $FILE | ||
git add $FILE | ||
done | ||
- name: Commit | ||
run: | | ||
HAS_CHANGES=$(git diff --staged --name-only) | ||
if [ ${#HAS_CHANGES} -gt 0 ]; then | ||
git config --global user.name mlcommons-bot | ||
git config --global user.email "[email protected]" | ||
git commit -m '[Automated Commit] Format Codebase' | ||
git push | ||
fi |
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
Oops, something went wrong.