forked from kernelci/kcidb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
47 lines (47 loc) · 1.49 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
language: python
dist: xenial
python:
- "3.6"
install:
- pip3 install '.[dev]'
script:
- |
# Check both install_requires in setup.py and requirements.txt contain
# the same dependencies
(
# NOTE: Option change is contained within the subshell to avoid
# breaking the Travis CI wrapper
set -e -u -o pipefail
unique_requires=$({
sed -n '/install_requires=/,/],/ s/.*"\([^"]\+\)".*/\1/p' setup.py |
sort -u
grep -v '^#' requirements.txt |
sort -u
} | sort | uniq -u)
if [ -n "$unique_requires" ]; then
echo "Requirements not both in setup.py and requirements.txt:" >&2
echo "$unique_requires" >&2
false
fi
)
- "flake8 kcidb *.py"
- "pylint kcidb *.py"
- find -name '*.yaml' | xargs yamllint
- kcidb-tests-validate --urls < tests.yaml
- |
test_list=$(
python3 <(
echo "import sys, yaml"
echo "for k in yaml.safe_load(sys.stdin).keys():"
echo " print(k)"
) < tests.yaml
)
test_list_diff=$(diff -u <(echo "$test_list") \
<(echo "$test_list" | sort)) ||
{
echo "Tests out of alphabetic order." >&2
echo "Change the order as below:" >&2
echo "$test_list_diff" >&2
false
}
- pytest