-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create pull_request.yml * Apply clang-format
- Loading branch information
Showing
13 changed files
with
1,040 additions
and
1,069 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,33 @@ | ||
name: Pull Request | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: geertvdc/setup-hub@master | ||
- name: Dependencies | ||
run: | | ||
sudo apt-get -y install jq clang-format-8 | ||
sudo cp $(which clang-format-8) /bin/clang-format | ||
- name: Checkout PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
hub pr checkout $(jq -r ".number" "$GITHUB_EVENT_PATH") | ||
- name: Clang Format | ||
run: | | ||
SRC=$(git ls-tree --full-tree -r HEAD | grep -e "\.\(c\|h\|cc\|hh\|hpp\|cpp\)\$" | cut -f 2) | ||
wget https://raw.githubusercontent.com/NetSys/bess/master/core/.clang-format | ||
clang-format -style=file -i $SRC | ||
rm .clang-format | ||
- name: Commit and push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git | ||
git config --global user.email "actions@github" | ||
git config --global user.name "Github Actions" | ||
hub commit -a -m "Apply clang-format" && hub push || echo "Nothing to commit" |
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
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
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.