File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Stop on errors
4
+ set -e
5
+
6
+ # Log information about the run of this check.
7
+ echo " Pull request's base branch is: ${BASE_BRANCH} "
8
+ echo " Pull request's merge branch is: ${MERGE_BRANCH} "
9
+ echo " Pull request's source branch is: ${GITHUB_HEAD_REF} "
10
+
11
+ # The checkout action leaves us in detatched head state. The following line
12
+ # names the checked out commit, for simpler reference later.
13
+ git checkout -b ${MERGE_BRANCH}
14
+
15
+ # Make sure we can refer to ${BASE_BRANCH} by name
16
+ git checkout ${BASE_BRANCH}
17
+ git checkout ${MERGE_BRANCH}
18
+
19
+ # Find the commit on which the PR is based.
20
+ MERGE_BASE=$( git merge-base ${BASE_BRANCH} ${MERGE_BRANCH} )
21
+ echo " Checking standards of code touched since $MERGE_BASE "
22
+
23
+ # Do the checking.
24
+ script_folder=' ./scripts'
25
+ $script_folder /run_diff.sh CPPLINT $MERGE_BASE
Original file line number Diff line number Diff line change @@ -144,3 +144,24 @@ jobs:
144
144
BASE_BRANCH : ${{ github.base_ref }}
145
145
MERGE_BRANCH : ${{ github.ref }}
146
146
run : ./.github/workflows/pull-request-check-clang-format.sh
147
+
148
+ check-cpplint :
149
+ runs-on : ubuntu-20.04
150
+ steps :
151
+ - uses : actions/checkout@v2
152
+ with :
153
+ submodules : true
154
+ fetch-depth : 0
155
+ - name : Fetch dependencies
156
+ env :
157
+ # This is needed in addition to -yq to prevent apt-get from asking for
158
+ # user input
159
+ DEBIAN_FRONTEND : noninteractive
160
+ run : |
161
+ sudo apt-get install -yq pip
162
+ pip install unidiff
163
+ - name : Check updated lines of code match clang-format-7 style
164
+ env :
165
+ BASE_BRANCH : ${{ github.base_ref }}
166
+ MERGE_BRANCH : ${{ github.ref }}
167
+ run : ./.github/workflows/pull-request-check-cpplint.sh
You can’t perform that action at this time.
0 commit comments