forked from avocado-framework-tests/avocado-misc-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
77 lines (71 loc) · 2.35 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
language: python
dist: jammy
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
branches:
only:
- master
cache:
directories:
- $HOME/.cache/pip
sudo: false
install:
- pip install -r requirements-travis.txt
script:
- inspekt checkall --disable-lint W,R,C,E1002,E1101,E1103,E1120,F0401,I0011,E0203,E711,W605,E721 --no-license-check
- inspekt indent
- inspekt style
- |
error=""
for COMMIT in $(git rev-list $TRAVIS_COMMIT_RANGE); do
echo
echo "-----< $(git log -1 --oneline $COMMIT) >-----"
msg=$(git show -s --format=%B $COMMIT)
# Skip merge commits
if [ $(echo "${msg::4}") == 'Merg' ]
then
continue
fi
# Skip some commits which make travis fail due to commit message
list='8fd5b57 840e774 c35ffeb'
for item in $list
do
if [ "$COMMIT" == "$item" ]; then
echo "In the list"
continue
fi
done
# Test commit message size
if [ $(echo "$msg" | wc -l) -ge 5 ]
then
echo "OK: Commit message size."
else
echo "ERR: Commit message is too short (less than 5 lines)."
echo " Here a minimal template:"
echo " ------------------------------------"
echo " header <- Limited to 50 characters. No period."
echo " <- Blank line"
echo " message <- Any number of lines, limited to 72 characters per line."
echo " <- Blank line"
echo " Signed-off-by: <- Signature (created by git commit -s)"
echo " ------------------------------------"
error=true
fi
# Test commit message signature
if echo "$msg" | grep -q 'Signed-off-by:'
then
echo "OK: 'Signed-off-by:' present."
else
echo "ERR: 'Signed-off-by:' not found (use '-s' in 'git commit')."
error=true
fi
done
# Look for errors
if [ "$error" ]; then
echo
echo "Incremental smokecheck failed."
exit 1
fi