Skip to content

Commit 6ae2ad2

Browse files
authored
Use arduino/cpp-test-action in Unit Test CI workflow (#206)
1 parent 12f5d2c commit 6ae2ad2

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

Diff for: .github/workflows/unit-tests.yml

+10-21
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,23 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
env:
22-
BUILD_PATH: "${{ github.workspace }}/extras/test/build"
22+
COVERAGE_DATA_PATH: extras/coverage-data/coverage.info
2323

2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@v2
2727

28-
- name: Install valgrind
29-
run: |
30-
sudo apt-get install valgrind
31-
32-
- name: Run unit tests
33-
run: |
34-
mkdir "$BUILD_PATH"
35-
cd "$BUILD_PATH"
36-
cmake ..
37-
make
38-
valgrind --leak-check=yes --error-exitcode=1 bin/testArduinoIoTCloud
39-
40-
- name: Check code coverage
41-
run: |
42-
cd "$BUILD_PATH"
43-
sudo apt-get --assume-yes install lcov > /dev/null
44-
lcov --directory . --capture --output-file coverage.info
45-
lcov --quiet --remove coverage.info '*/extras/test/*' '/usr/*' '*/src/cbor/lib/*' --output-file coverage.info
46-
lcov --list coverage.info
28+
- uses: arduino/cpp-test-action@main
29+
with:
30+
runtime-path: extras/test/build/bin/testArduinoIoTCloud
31+
coverage-exclude-paths: |
32+
- '*/extras/test/*'
33+
- '/usr/*'
34+
- '*/src/cbor/lib/*'
35+
coverage-data-path: ${{ env.COVERAGE_DATA_PATH }}
4736

4837
- name: Upload coverage report to Codecov
4938
uses: codecov/codecov-action@v1
5039
with:
51-
file: "${{ env.BUILD_PATH }}/coverage.info"
40+
file: "${{ env.COVERAGE_DATA_PATH }}"
5241
fail_ci_if_error: true

0 commit comments

Comments
 (0)