@@ -46,6 +46,8 @@ before_install:
46
46
# Setup ppa to make sure arm-none-eabi-gcc is correct version
47
47
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
48
48
- sudo add-apt-repository -y ppa:deadsnakes/ppa
49
+ # workaround for https://travis-ci.community/t/then-sudo-apt-get-update-failed-public-key-is-not-available-no-pubkey-6b05f25d762e3157-in-ubuntu-xenial/1728
50
+ - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 762E3157
49
51
# Loop until update succeeds (timeouts can occur)
50
52
- travis_retry $(! sudo apt-get update 2>&1 |grep Failed)
51
53
@@ -105,7 +107,7 @@ matrix:
105
107
# Install dependencies
106
108
- sudo apt-get install gcc-arm-embedded
107
109
- pip install -r requirements.txt
108
- - pip install pytest pylint hypothesis mock coverage coveralls
110
+ - pip install pytest pylint hypothesis==3.88.3 mock coverage coveralls
109
111
# Print versions we use
110
112
111
113
- arm-none-eabi-gcc --version
@@ -134,43 +136,25 @@ matrix:
134
136
- env :
135
137
- NAME=astyle
136
138
install :
137
- - curl -L0 https://mbed-os.s3-eu-west-1.amazonaws.com/builds/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
138
- mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
139
- pushd BUILD/astyle/build/gcc;
140
- make;
141
- export PATH=$PWD/bin:$PATH;
142
- popd;
143
- - astyle --version
139
+ - >-
140
+ curl -L0 https://mbed-os.s3-eu-west-1.amazonaws.com/builds/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
141
+ mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
142
+ cd BUILD/astyle/build/gcc;
143
+ make;
144
+ export PATH=$PWD/bin:$PATH;
145
+ cd -
146
+ - astyle --version
147
+ # Fetch remaining information needed for branch comparison
148
+ - git fetch --all --unshallow --tags
149
+ - git fetch origin "${TRAVIS_BRANCH}"
144
150
script :
145
- # only changed files this time
146
- git diff --name-only --diff-filter=d $TRAVIS_BRANCH | grep '.*\.\(h\|c\|hpp\|cpp\)$' | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle-files-changed.out;
147
- if [ $(cat astyle-files-changed.out | grep Formatted | wc -l) -ne 0 ]; then
148
- git --no-pager diff;
149
- echo "";
150
- echo "AStyle check failed, please fix style issues as shown above";
151
- (exit 1);
152
- else
153
- echo "Coding style check OK";
154
- fi
155
- after_success :
156
- # run astyle for all files on the branch
157
- - git checkout -- .
158
- - find -regex '.*\.\(h\|c\|hpp\|cpp\)$' -type f | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle-branch.out;
159
- # update status if we succeeded, compare with master if possible
160
- - |
161
- CURR=$(cat astyle-branch.out | grep Formatted | wc -l)
162
- PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
163
- | jq -re "select(.sha != \"$TRAVIS_COMMIT\")
164
- | .statuses[] | select(.context == \"travis-ci/$NAME\").description
165
- | capture(\", (?<files>[0-9]+) files\").files" \
166
- || echo 0)
151
+ - >-
152
+ git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
153
+ | ( grep '.\(c\|cpp\|h\|hpp\)$' || true ) \
154
+ | ( fgrep -v -f .astyleignore || true ) \
155
+ | while read file; do astyle -n --options=.astylerc "${file}"; done
156
+ - git diff --exit-code --diff-filter=d --color
167
157
168
- STATUSM="Passed, ${CURR} files"
169
- if [ "$PREV" -ne 0 ]
170
- then
171
- STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") files)"
172
- fi
173
- - bash -c "$STATUS" success "$STATUSM"
174
158
- env :
175
159
- NAME=events
176
160
- EVENTS=events
@@ -294,6 +278,7 @@ matrix:
294
278
- echo 'Checking that there is no GPL licence text in code'
295
279
- ! git grep -q --ignore-case "gnu general public";
296
280
- ! git grep -q --ignore-case "gnu library general public";
281
+
297
282
- env :
298
283
- NAME=psa-autogen
299
284
script :
0 commit comments