Skip to content

Commit ff25681

Browse files
committed
Separated out logical Travis jobs
Combination of mbed 2 builds (~40 minutes), littlefs testing (~15 minutes), and miscellaneous testing pushed the current CI over Travis's limit of 1 hour per job. However, by using Travis's matrix includes, we can spin up different jobs for the various logical components being tested.
1 parent 47684d8 commit ff25681

File tree

1 file changed

+154
-79
lines changed

1 file changed

+154
-79
lines changed

.travis.yml

Lines changed: 154 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,163 @@
1-
python:
2-
- "2.7"
31

4-
script:
5-
# Assert that the Doxygen build produced no warnings.
6-
# The strange command below asserts that the Doxygen command had an
7-
# output of zero length
8-
- |
9-
doxygen doxyfile_options 2>&1 | tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
10-
# Assert that all binary libraries are named correctly
11-
# The strange command below asserts that there are exactly 0 libraries that do
12-
# not start with lib
13-
- |
14-
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" | tee BUILD/badlibs | sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
15-
# Assert that all assebler files are named correctly
16-
# The strange command below asserts that there are exactly 0 libraries that do
17-
# end with .s
18-
- |
19-
find -name "*.s" | tee BUILD/badasm | sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
20-
# Run local testing on tools
21-
# Note: These take ~40 minutes to run
22-
- PYTHONPATH=. coverage run -a -m pytest tools/test
23-
- python2 tools/test/pylint.py
24-
- coverage run -a tools/project.py -S | sed -n '/^Total/p'
25-
- python2 -u tools/build_travis.py | sed -n '/^Executing/p'
26-
- coverage html
27-
# Run local event queue tests
28-
- make -C events/equeue test
29-
# Run local littlefs tests
30-
- CFLAGS="-Wno-format" make -Cfeatures/filesystem/littlefs/littlefs test QUIET=1
31-
# Run local littlefs tests with set of variations
32-
- CFLAGS="-Wno-format -DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64" make -Cfeatures/filesystem/littlefs/littlefs test QUIET=1
33-
- CFLAGS="-Wno-format -DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1" make -Cfeatures/filesystem/littlefs/littlefs test QUIET=1
34-
- CFLAGS="-Wno-format -DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make -Cfeatures/filesystem/littlefs/littlefs test QUIET=1
35-
- CFLAGS="-Wno-format -DLFS_BLOCK_COUNT=1023" make -Cfeatures/filesystem/littlefs/littlefs test QUIET=1
36-
- CFLAGS="-Wno-format -DLFS_LOOKAHEAD=2048" make -Cfeatures/filesystem/littlefs/littlefs test QUIET=1
37-
# Self-hosting littlefs fuzz test with littlefs-fuse
38-
- make -C littlefs-fuse
39-
- littlefs-fuse/lfs --format /dev/loop0
40-
- littlefs-fuse/lfs /dev/loop0 MOUNT
41-
- ls MOUNT
42-
- mkdir MOUNT/littlefs
43-
- cp -r $(git ls-tree --name-only HEAD features/filesystem/littlefs/littlefs/) MOUNT/littlefs
44-
- ls MOUNT/littlefs
45-
- CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs QUIET=1
46-
47-
after_success:
48-
# Coverage for tools
49-
- coveralls
2+
env:
3+
global:
4+
- >
5+
STATUS=$'curl -so/dev/null --user $MBED_BOT --request POST
6+
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}
7+
--data @- << DATA\n{
8+
"state": "$0",
9+
"description": "$1",
10+
"context": "travis-ci/$NAME",
11+
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
12+
}\nDATA'
5013
5114
before_install:
15+
- bash -c "$STATUS" pending "Local $NAME testing is in progress"
16+
# Make sure pipefail
17+
- set -o pipefail
5218
# Setup ppa to make sure arm-none-eabi-gcc is correct version
5319
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
5420
- sudo add-apt-repository -y ppa:libreoffice/libreoffice-4-2
5521
- sudo apt-get update -qq
5622

57-
install:
58-
# Install dependencies
59-
- sudo apt-get install -qq gcc-arm-embedded doxygen libfuse-dev
60-
- pip install --user -r requirements.txt
61-
- pip install --user pytest
62-
- pip install --user pylint
63-
- pip install --user hypothesis
64-
- pip install --user mock
65-
- pip install --user coverage
66-
- pip install --user coveralls
67-
# Print versions we use
68-
- arm-none-eabi-gcc --version
69-
- python --version
70-
- doxygen --version
71-
- gcc --version
72-
- fusermount --version
23+
after_success:
24+
- bash -c "$STATUS" success "Local $NAME testing has passed"
25+
26+
after_failure:
27+
- bash -c "$STATUS" failure "Local $NAME testing has failed"
28+
29+
matrix:
30+
include:
31+
- python: '2.7'
32+
env:
33+
- NAME=tools
34+
install:
35+
# Install dependencies
36+
- sudo apt-get install gcc-arm-embedded doxygen
37+
- pip install --user -r requirements.txt
38+
- pip install --user pytest
39+
- pip install --user pylint
40+
- pip install --user hypothesis
41+
- pip install --user mock
42+
- pip install --user coverage
43+
- pip install --user coveralls
44+
# Print versions we use
45+
- arm-none-eabi-gcc --version
46+
- python --version
47+
- doxygen --version
48+
before_script:
49+
# Create BUILD directory for tests
50+
- mkdir BUILD
51+
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 ]
67+
# Run local testing on tools
68+
# Note: These take ~40 minutes to run
69+
- PYTHONPATH=. coverage run -a -m pytest tools/test
70+
- python2 tools/test/pylint.py
71+
- coverage run -a tools/project.py -S | sed -n '/^Total/p'
72+
# - python2 -u tools/build_travis.py | sed -n '/^Executing/p'
73+
- coverage html
74+
after_success:
75+
# Coverage for tools
76+
- coveralls
77+
# Report success since we have overridden default behaviour
78+
- bash -c "$STATUS" success "Local $NAME testing has passed"
79+
80+
- python: '2.7'
81+
env:
82+
- NAME=events
83+
- EVENTS=events
84+
install:
85+
# Install dependencies
86+
- sudo apt-get install gcc-arm-embedded
87+
- pip install --user -r requirements.txt
88+
# Print versions we use
89+
- arm-none-eabi-gcc --version
90+
- gcc --version
91+
- python --version
92+
script:
93+
# Check that example compiles
94+
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
95+
- python tools/make.py -t GCC_ARM -m K64F --source=. --build=BUILD/K64F/GCC_ARM -j0
96+
# Run local equeue tests
97+
- make -C $EVENTS/equeue test
98+
99+
- python: '2.7'
100+
env:
101+
- NAME=littlefs
102+
- LITTLEFS=features/filesystem/littlefs
103+
install:
104+
# Install dependencies
105+
- sudo apt-get install gcc-arm-embedded fuse libfuse-dev
106+
- pip install --user -r requirements.txt
107+
- git clone https://github.com/armmbed/spiflash-driver.git
108+
# Print versions
109+
- arm-none-eabi-gcc --version
110+
- gcc --version
111+
- python --version
112+
- fusermount --version
113+
before_script:
114+
# Setup and patch littlefs-fuse
115+
- git clone https://github.com/geky/littlefs-fuse littlefs_fuse
116+
- echo '*' > littlefs_fuse/.mbedignore
117+
- rm -rf littlefs_fuse/littlefs/*
118+
- cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) littlefs_fuse/littlefs
119+
# Create file-backed disk
120+
- mkdir MOUNT
121+
- sudo chmod a+rw /dev/loop0
122+
- dd if=/dev/zero bs=512 count=2048 of=DISK
123+
- losetup /dev/loop0 DISK
124+
script:
125+
# Check that example compiles
126+
- sed -n '/``` c++/,/```/{/```/d;p;}' $LITTLEFS/README.md > main.cpp
127+
- python tools/make.py -t GCC_ARM -m K82F --source=. --build=BUILD/K82F/GCC_ARM -j0
128+
# Run local littlefs tests
129+
- CFLAGS="-Wno-format" make -C$LITTLEFS/littlefs test QUIET=1
130+
# Run local littlefs tests with set of variations
131+
- CFLAGS="-Wno-format -DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64" make -C$LITTLEFS/littlefs test QUIET=1
132+
- CFLAGS="-Wno-format -DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1" make -C$LITTLEFS/littlefs test QUIET=1
133+
- CFLAGS="-Wno-format -DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make -C$LITTLEFS/littlefs test QUIET=1
134+
- CFLAGS="-Wno-format -DLFS_BLOCK_COUNT=1023" make -C$LITTLEFS/littlefs test QUIET=1
135+
- CFLAGS="-Wno-format -DLFS_LOOKAHEAD=2048" make -C$LITTLEFS/littlefs test QUIET=1
136+
# Self-hosting littlefs fuzz test with littlefs-fuse
137+
- make -Clittlefs_fuse
138+
- littlefs_fuse/lfs --format /dev/loop0
139+
- littlefs_fuse/lfs /dev/loop0 MOUNT
140+
- ls MOUNT
141+
- mkdir MOUNT/littlefs
142+
- cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) MOUNT/littlefs
143+
- ls MOUNT/littlefs
144+
- CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs QUIET=1
145+
146+
- python: '2.7'
147+
env:
148+
- NAME=mbed2
149+
install:
150+
# Install dependencies
151+
- sudo apt-get install gcc-arm-embedded
152+
- pip install --user -r requirements.txt
153+
# Print versions we use
154+
- arm-none-eabi-gcc --version
155+
- python --version
156+
before_script:
157+
# Create BUILD directory for tests
158+
- mkdir BUILD
159+
script:
160+
# Run local mbed 2 testing
161+
# Note: These take ~40 minutes to run
162+
- python2 -u tools/build_travis.py | sed -n '/^Executing/p'
73163

74-
before_script:
75-
# Create BUILD directory for tests
76-
- mkdir BUILD
77-
# Make sure pipefail
78-
- set -o pipefail
79-
# Setup and patch littlefs-fuse
80-
- git clone https://github.com/geky/littlefs-fuse
81-
- echo '*' > littlefs-fuse/.mbedignore
82-
- rm -rf littlefs-fuse/littlefs/*
83-
- cp -r $(git ls-tree --name-only HEAD features/filesystem/littlefs/littlefs/) littlefs-fuse/littlefs
84-
# Create file-backed disk
85-
- mkdir MOUNT
86-
- sudo chmod a+rw /dev/loop0
87-
- dd if=/dev/zero bs=512 count=2048 of=DISK
88-
- losetup /dev/loop0 DISK

0 commit comments

Comments
 (0)