-
Notifications
You must be signed in to change notification settings - Fork 273
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 #5457 from thomasspriggs/tas/gha_ancillaries
Port ancillary jobs from Travis to github actions
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 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,38 @@ | ||
#!/bin/bash | ||
|
||
# Stop on errors | ||
set -e | ||
|
||
# Log information about the run of this check. | ||
echo "Pull request's base branch is: ${BASE_BRANCH}" | ||
echo "Pull request's merge branch is: ${MERGE_BRANCH}" | ||
echo "Pull request's source branch is: ${GITHUB_HEAD_REF}" | ||
clang-format-7 --version | ||
|
||
# The checkout action leaves us in detatched head state. The following line | ||
# names the checked out commit, for simpler reference later. | ||
git checkout -b ${MERGE_BRANCH} | ||
|
||
# Build list of files to ignore | ||
while read file ; do EXCLUDES+="':(top,exclude)$file' " ; done < .clang-format-ignore | ||
|
||
# Make sure we can refer to ${BASE_BRANCH} by name | ||
git checkout ${BASE_BRANCH} | ||
git checkout ${MERGE_BRANCH} | ||
|
||
# Find the commit on which the PR is based. | ||
MERGE_BASE=$(git merge-base ${BASE_BRANCH} ${MERGE_BRANCH}) | ||
echo "Checking for formatting errors introduced since $MERGE_BASE" | ||
|
||
# Do the checking. "eval" is used so that quotes (as inserted into $EXCLUDES | ||
# above) are not interpreted as parts of file names. | ||
eval git-clang-format-7 --binary clang-format-7 $MERGE_BASE -- $EXCLUDES | ||
git diff > formatted.diff | ||
if [[ -s formatted.diff ]] ; then | ||
echo 'Formatting error! The following diff shows the required changes' | ||
echo 'Use the raw log to get a version of the diff that preserves spacing' | ||
cat formatted.diff | ||
exit 1 | ||
fi | ||
echo 'No formatting errors found' | ||
exit 0 |
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,24 @@ | ||
#!/bin/bash | ||
|
||
# Stop on errors | ||
set -e | ||
|
||
# Log information about the run of this check. | ||
echo "Pull request's base branch is: ${BASE_BRANCH}" | ||
echo "Pull request's merge branch is: ${MERGE_BRANCH}" | ||
echo "Pull request's source branch is: ${GITHUB_HEAD_REF}" | ||
|
||
# The checkout action leaves us in detatched head state. The following line | ||
# names the checked out commit, for simpler reference later. | ||
git checkout -b ${MERGE_BRANCH} | ||
|
||
# Make sure we can refer to ${BASE_BRANCH} by name | ||
git checkout ${BASE_BRANCH} | ||
git checkout ${MERGE_BRANCH} | ||
|
||
# Find the commit on which the PR is based. | ||
MERGE_BASE=$(git merge-base ${BASE_BRANCH} ${MERGE_BRANCH}) | ||
echo "Checking standards of code touched since $MERGE_BASE" | ||
|
||
# Do the checking. | ||
./scripts/run_diff.sh CPPLINT $MERGE_BASE |
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