Skip to content

Commit 992c905

Browse files
authored
Merge pull request #5678 from geky/travis-caching
Add caching of apt-get + pip to .travis.yml
2 parents 484b4a2 + b7c1598 commit 992c905

File tree

1 file changed

+42
-23
lines changed

1 file changed

+42
-23
lines changed

.travis.yml

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ env:
1111
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
1212
}\nDATA'
1313
14+
cache:
15+
pip: true
16+
directories:
17+
- $HOME/.cache/apt
18+
1419
before_install:
1520
- bash -c "$STATUS" pending "Local $NAME testing is in progress"
1621
# Make sure pipefail
1722
- set -o pipefail
23+
# Setup apt to cache
24+
- mkdir -p $HOME/.cache/apt/partial
25+
- sudo rm -rf /var/cache/apt/archives
26+
- sudo ln -s $HOME/.cache/apt /var/cache/apt/archives
1827
# Setup ppa to make sure arm-none-eabi-gcc is correct version
1928
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
20-
- sudo add-apt-repository -y ppa:libreoffice/libreoffice-4-2
2129
- sudo apt-get update -qq
2230

2331
after_success:
@@ -28,12 +36,44 @@ after_failure:
2836

2937
matrix:
3038
include:
39+
- python: '2.7'
40+
env:
41+
- NAME=docs
42+
install:
43+
# Install dependencies
44+
- sudo apt-get install doxygen
45+
# Print versions we use
46+
- doxygen --version
47+
before_script:
48+
# Create BUILD directory for tests
49+
- mkdir BUILD
50+
script:
51+
# Assert that the Doxygen build produced no warnings.
52+
# The strange command below asserts that the Doxygen command had an
53+
# output of zero length
54+
- >
55+
doxygen doxyfile_options 2>&1 |
56+
tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
57+
# Assert that all binary libraries are named correctly
58+
# The strange command below asserts that there are exactly 0 libraries
59+
# that do not start with lib
60+
- >
61+
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" |
62+
tee BUILD/badlibs |
63+
sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
64+
# Assert that all assebler files are named correctly
65+
# The strange command below asserts that there are exactly 0 libraries
66+
# that do end with .s
67+
- >
68+
find -name "*.s" | tee BUILD/badasm |
69+
sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
70+
3171
- python: '2.7'
3272
env:
3373
- NAME=tools
3474
install:
3575
# Install dependencies
36-
- sudo apt-get install gcc-arm-embedded doxygen
76+
- sudo apt-get install gcc-arm-embedded
3777
- pip install --user -r requirements.txt
3878
- pip install --user pytest
3979
- pip install --user pylint
@@ -44,32 +84,11 @@ matrix:
4484
# Print versions we use
4585
- arm-none-eabi-gcc --version
4686
- python --version
47-
- doxygen --version
48-
before_script:
49-
# Create BUILD directory for tests
50-
- mkdir BUILD
5187
script:
52-
# Assert that the Doxygen build produced no warnings.
53-
# The strange command below asserts that the Doxygen command had an
54-
# output of zero length
55-
- |
56-
doxygen doxyfile_options 2>&1 | tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
57-
# Assert that all binary libraries are named correctly
58-
# The strange command below asserts that there are exactly 0 libraries that do
59-
# not start with lib
60-
- |
61-
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" | tee BUILD/badlibs | sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
62-
# Assert that all assebler files are named correctly
63-
# The strange command below asserts that there are exactly 0 libraries that do
64-
# end with .s
65-
- |
66-
find -name "*.s" | tee BUILD/badasm | sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
6788
# Run local testing on tools
68-
# Note: These take ~40 minutes to run
6989
- PYTHONPATH=. coverage run -a -m pytest tools/test
7090
- python2 tools/test/pylint.py
7191
- coverage run -a tools/project.py -S | sed -n '/^Total/p'
72-
# - python2 -u tools/build_travis.py | sed -n '/^Executing/p'
7392
- coverage html
7493
after_success:
7594
# Coverage for tools

0 commit comments

Comments
 (0)