-
Notifications
You must be signed in to change notification settings - Fork 80
48 lines (40 loc) · 1.12 KB
/
unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Unit Tests
on:
pull_request:
paths:
- ".github/workflows/unit-tests.yml"
- 'extras/test/**'
- 'src/**'
push:
paths:
- ".github/workflows/unit-tests.yml"
- 'extras/test/**'
- 'src/**'
jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
env:
BUILD_PATH: "${{ github.workspace }}/extras/test/build"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run unit tests
run: |
mkdir "$BUILD_PATH"
cd "$BUILD_PATH"
cmake ..
make
bin/testArduinoIoTCloud
- name: Check code coverage
run: |
cd "$BUILD_PATH"
sudo apt-get --assume-yes install lcov > /dev/null
lcov --directory . --capture --output-file coverage.info
lcov --quiet --remove coverage.info '*/extras/test/*' '/usr/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1
with:
file: "${{ env.BUILD_PATH }}/coverage.info"
fail_ci_if_error: true