-
Notifications
You must be signed in to change notification settings - Fork 10
56 lines (47 loc) · 1.79 KB
/
unit-tests.yml
File metadata and controls
56 lines (47 loc) · 1.79 KB
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
49
50
51
52
53
54
55
56
name: Unit Tests
on:
pull_request:
# Only run workflow if a file in these paths is modified
paths:
- ".github/workflows/unit-tests.yml"
- "ArduinoCore-API/test/**"
- "ArduinoCore-API/api/**"
push:
paths:
- ".github/workflows/unit-tests.yml"
- "ArduinoCore-API/test/**"
- "ArduinoCore-API/api/**"
jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
env:
COVERAGE_DATA_PATH: extras/coverage-data/coverage.info
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Relax some warings
# run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt
# run: echo 'add_compile_options(-Wno-error=all)' >> ArduinoCore-API/test/CMakeLists.txt
# run: echo 'add_compile_options(-Wno-error=unused-function)' >> ArduinoCore-API/test/CMakeLists.txt
run: sed -i 's/-Werror//g' ArduinoCore-API/test/CMakeLists.txt
# See: https://github.com/arduino/cpp-test-action/blob/main/README.md
- uses: arduino/cpp-test-action@main
with:
source-path: ArduinoCore-API/test
build-path: ArduinoCore-API/test/build
runtime-path: ArduinoCore-API/test/build/bin/test-ArduinoCore-API
coverage-exclude-paths: |
- '*/test/*'
- '/usr/*'
coverage-data-path: ${{ env.COVERAGE_DATA_PATH }}
# Temporary excluded to prevent token requirement
# See: https://github.com/codecov/codecov-action/blob/master/README.md
#- name: Code coverage
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ${{ env.COVERAGE_DATA_PATH }}
# fail_ci_if_error: true