File tree 3 files changed +53
-0
lines changed
3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Unit Tests
2
+
3
+ on :
4
+ pull_request :
5
+ paths :
6
+ - " .github/workflows/unit-tests.yml"
7
+ - ' extras/test/**'
8
+ - ' src/**'
9
+
10
+ push :
11
+ paths :
12
+ - " .github/workflows/unit-tests.yml"
13
+ - ' extras/test/**'
14
+ - ' src/**'
15
+
16
+ jobs :
17
+ test :
18
+ name : Run unit tests
19
+ runs-on : ubuntu-latest
20
+
21
+ env :
22
+ BUILD_PATH : " ${{ github.workspace }}/extras/test/build"
23
+
24
+ steps :
25
+ - name : Checkout
26
+ uses : actions/checkout@v2
27
+
28
+ - name : Run unit tests
29
+ run : |
30
+ mkdir "$BUILD_PATH"
31
+ cd "$BUILD_PATH"
32
+ cmake ..
33
+ make
34
+ bin/testArduinoIoTCloud
35
+
36
+ - name : Check code coverage
37
+ run : |
38
+ cd "$BUILD_PATH"
39
+ sudo apt-get --assume-yes install lcov > /dev/null
40
+ lcov --directory . --capture --output-file coverage.info
41
+ lcov --quiet --remove coverage.info '*/extras/test/*' '/usr/*' --output-file coverage.info
42
+ lcov --list coverage.info
43
+
44
+ - name : Upload coverage report to Codecov
45
+ uses : codecov/codecov-action@v1
46
+ with :
47
+ file : " ${{ env.BUILD_PATH }}/coverage.info"
48
+ fail_ci_if_error : true
Original file line number Diff line number Diff line change 2
2
=================
3
3
[ ![ Compile Examples] ( https://github.com/arduino-libraries/ArduinoIoTCloud/workflows/Compile%20Examples/badge.svg )] ( https://github.com/arduino-libraries/ArduinoIoTCloud/actions?workflow=Compile+Examples )
4
4
[ ![ Spell Check] ( https://github.com/arduino-libraries/ArduinoIoTCloud/workflows/Spell%20Check/badge.svg )] ( https://github.com/arduino-libraries/ArduinoIoTCloud/actions?workflow=Spell+Check )
5
+ [ ![ Unit Tests] ( https://github.com/arduino-libraries/ArduinoIoTCloud/workflows/Unit%20Tests/badge.svg )] ( https://github.com/arduino-libraries/ArduinoIoTCloud/actions?workflow=Unit+Tests )
6
+ [ ![ codecov] ( https://codecov.io/gh/arduino-libraries/ArduinoIoTCloud/branch/master/graph/badge.svg )] ( https://codecov.io/gh/arduino-libraries/ArduinoIoTCloud )
5
7
6
8
### What?
7
9
The ` ArduinoIoTCloud ` library is the central element of the firmware enabling certain Arduino boards to connect to the [ Arduino IoT Cloud] ( https://www.arduino.cc/en/IoT/HomePage ) . The following boards are supported:
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ set(TEST_SRCS
36
36
add_compile_definitions (HOST)
37
37
add_compile_options (-Wall -Wextra -Wpedantic -Werror)
38
38
39
+ set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "--coverage" )
40
+ set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "--coverage" )
41
+
39
42
##########################################################################
40
43
41
44
add_executable (
You can’t perform that action at this time.
0 commit comments