File tree Expand file tree Collapse file tree 6 files changed +11
-14
lines changed Expand file tree Collapse file tree 6 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ set -o pipefail
11
11
command -v git > /dev/null 2>&1 || { echo >&2 " git is missing" ; exit 1; }
12
12
13
13
# grep will exit with 1 if no lines are found
14
- FILES=$( git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} | grep -v -e " old/" -e " generated/" -e " rust/vendor/" | grep -E " .py\$ " || exit 0)
14
+ FILES=$( git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} HEAD | grep -v -e " old/" -e " generated/" -e " rust/vendor/" | grep -E " .py\$ " || exit 0)
15
15
if [ -z " ${FILES} " ] ; then
16
16
exit 0
17
17
fi
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ if test -t 1; then
25
25
fi
26
26
fi
27
27
28
- if git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} | grep -v -E " (^src/(rust|ui/fonts)|.*ugui.*|.*base32.*)" | grep -E " ^(src|test)" | grep -E " \.(c|h)\$ " | xargs -n1 " $CLANGFORMAT " -output-replacements-xml | grep -c " <replacement " > /dev/null; then
28
+ if git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} HEAD | grep -v -E " (^src/(rust|ui/fonts)|.*ugui.*|.*base32.*)" | grep -E " ^(src|test)" | grep -E " \.(c|h)\$ " | xargs -n1 " $CLANGFORMAT " -output-replacements-xml | grep -c " <replacement " > /dev/null; then
29
29
echo -e " ${red} Not $CLANGFORMAT clean${normal} "
30
30
# Apply CF to the files
31
- git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} | grep -v -E " (^src/(rust|ui/fonts)|.*ugui.*|.*base32.*)" | grep -E " ^(src|test)" | grep -E " \.(c|h)\$ " | xargs -n1 " $CLANGFORMAT " -i
31
+ git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} HEAD | grep -v -E " (^src/(rust|ui/fonts)|.*ugui.*|.*base32.*)" | grep -E " ^(src|test)" | grep -E " \.(c|h)\$ " | xargs -n1 " $CLANGFORMAT " -i
32
32
# Print list of files that weren't formatted correctly
33
33
echo -e " Incorrectly formatted files:"
34
34
git --no-pager diff --name-only
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ for dir in build build-build; do
36
36
s/-Wno-cast-function-type//g; s/-mfpu=fpv4-sp-d16//g; s/-Wformat-signedness//g' ${dir} /compile_commands.json
37
37
38
38
# Only check our files
39
- SOURCES1=$( git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} | \
39
+ SOURCES1=$( git --no-pager diff --diff-filter=d --name-only ${TARGET_BRANCH} HEAD | \
40
40
grep -v -E " (^src/(drivers|ui/fonts)|.*ugui.*|.*base32.*)" | \
41
41
grep -E " ^(src)" | \
42
42
grep -v " ^test/unit-test/u2f/" | \
Original file line number Diff line number Diff line change 18
18
# It accepts two positional arguments:
19
19
# 1. A workspace dir, the root of the git repo clone, or "pull" literal.
20
20
# In the latter case, CI container image is pulled from a registry.
21
- # 2. An optional target branch for code style diffs. Defaults to "master" for
22
- # push commits and overwritten with TRAVIS_BRANCH env var for pull requests
23
- # when run on Travis CI.
21
+ # 2. A git revision (see man gitrevisions) to compare against HEAD to filter out modified and new
22
+ # files. Some scripts only run on that subset.
24
23
25
24
set -e
26
25
set -x
@@ -40,9 +39,7 @@ if [ -z "${WORKSPACE_DIR}" ]; then
40
39
exit 1
41
40
fi
42
41
43
- TARGET_BRANCH=" ${2:- master} "
44
- TARGET_BRANCH=origin/${TARGET_BRANCH}
45
-
42
+ TARGET_BRANCH=" $2 "
46
43
# The safe.directory config is so that git commands work. even though the repo folder mounted in
47
44
# Docker is owned by root, which can be different from the owner on the host.
48
45
docker run -e TARGET_BRANCH=" ${TARGET_BRANCH} " \
Original file line number Diff line number Diff line change 20
20
- name : Pull CI container image
21
21
run : ./.ci/run-container-ci pull
22
22
- name : Run CI in container
23
- run : ./.ci/run-container-ci ${{github.workspace}}
23
+ run : ./.ci/run-container-ci ${{github.workspace}} ${{ github.event.before }}
Original file line number Diff line number Diff line change 18
18
run : ./.ci/run-container-ci pull
19
19
20
20
- name : Run CI in container
21
- run : ./.ci/run-container-ci ${{github.workspace}} ${{ github.base_ref }}
21
+ run : ./.ci/run-container-ci ${{github.workspace}} ${{ github.event.pull_request.base.sha }}
22
22
23
23
# Generate a list of commits to run CI on
24
24
generate-matrix :
35
35
- name : Create jobs for commits in PR history
36
36
id : set-matrix
37
37
run : |
38
- echo matrix=$(.ci/matrix-from-commit-log origin/ ${{github.base_ref }}..${{ github.event.pull_request.head.sha}}~) >> $GITHUB_OUTPUT
38
+ echo matrix=$(.ci/matrix-from-commit-log ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}~) >> $GITHUB_OUTPUT
39
39
40
40
# Run this job for every commit in the PR except HEAD.
41
41
pr-commit-ci :
70
70
run : ./.ci/run-container-ci pull
71
71
72
72
- name : Run CI in container
73
- run : ./.ci/run-container-ci ${{github.workspace}} ${{ github.base_ref }}
73
+ run : ./.ci/run-container-ci ${{github.workspace}} ${{ github.event.pull_request.base.sha }}
You can’t perform that action at this time.
0 commit comments