-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
45 lines (41 loc) · 1.22 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
language: python
python:
- "3.6"
os:
- linux
#
# Astyle check
#
env:
- NAME=Astyle
install:
- curl -L0 https://fossies.org/linux/misc/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
pushd BUILD/astyle/build/gcc;
make;
export PATH=$PWD/bin:$PATH;
popd;
- astyle --version
before_script:
- cd $TRAVIS_BUILD_DIR/CI/astyle/
- echo "before_script"
script:
# Check coding style only on changed files for PR or all for master
- echo "script begin"
# - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then python astyle.py; fi
# - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then python astyle.py -b $TRAVIS_BRANCH; fi
- python astyle.py;
- TEST=$([[ -f astyle.out ]] && cat astyle.out | grep Formatted | wc -l || echo 0)
- |
if [[ $TEST -ne 0 ]]; then
cat astyle.out | grep Formatted
git --no-pager diff
echo "AStyle check failed, please fix style issues as shown above"
exit 1
else
echo "Coding style check OK";
fi
notifications:
email:
on_success: always
on_failure: always