Skip to content

Commit f43c0fb

Browse files
committed
Fail Travis CI build on compiler warnings
- In addition to the "All" compiler warning level (-Wall -Wextra -Wno-expansion-to-defined), add -Wpedantic - Add -Werror to fail CI build if any warnings are encountered build.extra_flags is used for other purposes in the SAMD boards.txt so it would not have been ideal to use that property to set the warning flags. For this reason, I used compiler.c.extra_flags, compiler.cpp.extra_flags, and compiler.S.extra_flags instead.
1 parent 2b190e8 commit f43c0fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: generic
22
env:
33
global:
44
- CLI_VERSION=latest
5+
- EXTRA_COMPILER_WARNING_FLAGS="-Wpedantic -Werror"
56
matrix:
67
include:
78
- env:
@@ -60,8 +61,8 @@ before_install:
6061
- arduino-cli lib install WiFi101
6162
- arduino-cli lib install WiFiNINA
6263
- arduino-cli lib install Ethernet
63-
- buildExampleSketch() { arduino-cli compile --warnings all --fqbn $BOARD $PWD/examples/$1; }
64-
- buildExampleUtilitySketch() { arduino-cli compile --warnings all --fqbn $BOARD $PWD/examples/utility/$1; }
64+
- buildExampleSketch() { arduino-cli compile --warnings all --build-properties compiler.c.extra_flags="${EXTRA_COMPILER_WARNING_FLAGS}" --build-properties compiler.cpp.extra_flags="${EXTRA_COMPILER_WARNING_FLAGS}" --build-properties compiler.S.extra_flags="${EXTRA_COMPILER_WARNING_FLAGS}" --fqbn $BOARD $PWD/examples/$1; }
65+
- buildExampleUtilitySketch() { arduino-cli compile --warnings all --build-properties compiler.c.extra_flags="${EXTRA_COMPILER_WARNING_FLAGS}" --build-properties compiler.cpp.extra_flags="${EXTRA_COMPILER_WARNING_FLAGS}" --build-properties compiler.S.extra_flags="${EXTRA_COMPILER_WARNING_FLAGS}" --fqbn $BOARD $PWD/examples/utility/$1; }
6566
install:
6667
- mkdir -p $HOME/Arduino/libraries
6768
- ln -s $PWD $HOME/Arduino/libraries/.

0 commit comments

Comments
 (0)