Skip to content

Commit f9f9b60

Browse files
Cruz Monrreal IICruz Monrreal II
authored andcommitted
Grouped jobs into build stages
1 parent c703ad7 commit f9f9b60

File tree

1 file changed

+107
-91
lines changed

1 file changed

+107
-91
lines changed

.travis.yml

Lines changed: 107 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,77 @@ before_install:
3939
# Loop until update succeeds (timeouts can occur)
4040
- travis_retry $(! sudo apt-get update 2>&1 |grep Failed)
4141

42+
4243
matrix:
4344
include:
44-
- env:
45-
- NAME=docs
45+
46+
### Basic Tests ###
47+
- &basic-vm
48+
stage: "Basic"
49+
name: "file attributes"
50+
env: NAME=gitattributestest
51+
script:
52+
- git diff --exit-code
53+
54+
- <<: *basic-vm
55+
name: "license check"
56+
env: NAME=license_check
57+
script:
58+
- |
59+
! grep --recursive --max-count=100 --ignore-case --exclude .travis.yml \
60+
"gnu general\|gnu lesser\|lesser general\|public license"
61+
62+
- <<: *basic-vm
63+
name: "include check"
64+
env: NAME=include_check
65+
script:
66+
- |
67+
! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
68+
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
69+
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*'
70+
71+
72+
### Docs Tests ###
73+
- &docs-vm
74+
stage: "Docs"
75+
name: "spellcheck"
76+
env: NAME=doxy-spellcheck
77+
install:
78+
- sudo apt-get install aspell
79+
script:
80+
# Run local testing on header file doxy
81+
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh drivers
82+
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh platform
83+
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh events
84+
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh rtos
85+
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh features/netsocket
86+
87+
- <<: *docs-vm
88+
name: "astyle"
89+
env: NAME=astyle
90+
install:
91+
- >-
92+
curl -L0 https://mbed-os.s3-eu-west-1.amazonaws.com/builds/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
93+
mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
94+
cd BUILD/astyle/build/gcc;
95+
make;
96+
export PATH=$PWD/bin:$PATH;
97+
cd -
98+
- astyle --version
99+
# Fetch remaining information needed for branch comparison
100+
- git fetch --all --unshallow --tags
101+
- git fetch origin "${TRAVIS_BRANCH}"
102+
script:
103+
- >-
104+
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
105+
| ( grep '.\(c\|cpp\|h\|hpp\)$' || true ) \
106+
| ( grep -v -f .astyleignore || true ) \
107+
| while read file; do astyle -n --options=.astylerc "${file}"; done
108+
- git diff --exit-code --diff-filter=d --color
109+
110+
- <<: *docs-vm
111+
name: "doxygen"
112+
env: NAME=docs
46113
install:
47114
# Install dependencies
48115
- sudo apt-get install doxygen
@@ -81,7 +148,11 @@ matrix:
81148
find -name "*.s" | tee BUILD/badasm |
82149
sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
83150
84-
- &tools-pytest
151+
152+
### Python Tests ###
153+
- &pytools-vm
154+
stage: "Pytest"
155+
name: "tools-py27"
85156
env: NAME=tools-py2.7
86157
python: 2.7
87158
install:
@@ -112,62 +183,36 @@ matrix:
112183
# Coverage for tools
113184
- coveralls
114185

115-
- env:
116-
- NAME=doxy-spellcheck
117-
118-
install:
119-
- sudo apt-get install aspell
120-
121-
script:
122-
# Run local testing on header file doxy
123-
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh drivers
124-
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh platform
125-
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh events
126-
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh rtos
127-
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh features/netsocket
128-
129-
after_success:
130-
# Coverage for tools
131-
- coveralls
132-
133-
- <<: *tools-pytest
186+
- <<: *pytools-vm
187+
name: "tools-py35"
134188
env: NAME=tools-py3.5
135189
python: 3.5
136190

137-
- <<: *tools-pytest
191+
- <<: *pytools-vm
192+
name: "tools-py36"
138193
env: NAME=tools-py3.6
139194
python: 3.6
140195

141-
- <<: *tools-pytest
196+
- <<: *pytools-vm
197+
name: "tools-py37"
142198
env: NAME=tools-py3.7
143199
python: 3.7
144-
dist: xenial
145200

146-
- env:
147-
- NAME=astyle
148-
install:
149-
- >-
150-
curl -L0 https://mbed-os-ci.s3-eu-west-1.amazonaws.com/jenkins-ci/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
151-
mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
152-
cd BUILD/astyle/build/gcc;
153-
make;
154-
export PATH=$PWD/bin:$PATH;
155-
cd -
156-
- astyle --version
157-
# Fetch remaining information needed for branch comparison
158-
- git fetch --all --unshallow --tags
159-
- git fetch origin "${TRAVIS_BRANCH}"
201+
202+
### Extended Tests ###
203+
- &extended-vm
204+
stage: "Extended"
205+
name: "psa autogen"
206+
env: NAME=psa-autogen
207+
language: python
208+
python: 3.7
160209
script:
161-
- >-
162-
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
163-
| ( grep '.\(c\|cpp\|h\|hpp\)$' || true ) \
164-
| ( grep -v -f .astyleignore || true ) \
165-
| while read file; do astyle -n --options=.astylerc "${file}"; done
166-
- git diff --exit-code --diff-filter=d --color
167-
168-
- env:
169-
- NAME=events
170-
- EVENTS=events
210+
- python tools/psa/generate_partition_code.py
211+
- git diff --exit-code
212+
213+
- <<: *extended-vm
214+
name: "events"
215+
env: NAME=events EVENTS=events
171216
install:
172217
# Install dependencies
173218
- sudo apt-get install gcc-arm-embedded
@@ -198,15 +243,15 @@ matrix:
198243
| capture(\"runtime is (?<runtime>[0-9]+)\").runtime" \
199244
|| echo 0)
200245
201-
#STATUSM="Passed, runtime is ${CURR} cycles"
202-
#if [ "$PREV" -ne 0 ]
203-
#then
204-
# STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") cycles)"
205-
#fi
246+
#STATUSM="Passed, runtime is ${CURR} cycles"
247+
#if [ "$PREV" -ne 0 ]
248+
#then
249+
# STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") cycles)"
250+
#fi
206251
207-
- env:
208-
- NAME=littlefs
209-
- LITTLEFS=features/storage/filesystem/littlefs
252+
- <<: *extended-vm
253+
name: "littlefs"
254+
env: NAME=littlefs LITTLEFS=features/storage/filesystem/littlefs
210255
install:
211256
# Install dependencies
212257
- sudo apt-get install gcc-arm-embedded fuse libfuse-dev
@@ -268,37 +313,8 @@ matrix:
268313
| capture(\"code size is (?<size>[0-9]+)\").size" \
269314
|| echo 0)
270315
271-
#STATUSM="Passed, code size is ${CURR}B"
272-
#if [ "$PREV" -ne 0 ]
273-
#then
274-
# STATUSM="$STATUSM ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
275-
#fi
276-
277-
- env:
278-
- NAME=gitattributestest
279-
script:
280-
# Check that no changes after clone. This check that .gitattributes is used right way.
281-
- git diff --exit-code
282-
283-
- env:
284-
- NAME=licence_check
285-
script:
286-
- >-
287-
! grep --recursive --max-count=100 --ignore-case --exclude .travis.yml \
288-
"gnu general\|gnu lesser\|lesser general\|public license"
289-
290-
- env:
291-
- NAME=include_check
292-
script:
293-
- echo 'Checking that there are no '#include "mbed.h"' in code where it should not be'
294-
- |
295-
! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
296-
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
297-
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*'
298-
299-
- env:
300-
- NAME=psa-autogen
301-
script:
302-
# Run SPM code generators and check that changes are not needed
303-
- python tools/psa/generate_partition_code.py
304-
- git diff --exit-code
316+
#STATUSM="Passed, code size is ${CURR}B"
317+
#if [ "$PREV" -ne 0 ]
318+
#then
319+
# STATUSM="$STATUSM ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
320+
#fi

0 commit comments

Comments
 (0)