Skip to content

Commit 6786160

Browse files
committed
gitignroe
1 parent 1cafaf5 commit 6786160

File tree

3 files changed

+82
-1
lines changed

3 files changed

+82
-1
lines changed

.github/workflows/c-cpp-cmake.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: build.sh
17+
run: ./build.sh

.github/workflows/unit-tests.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
# Only run workflow if a file in these paths is modified
6+
paths:
7+
- ".github/workflows/unit-tests.yml"
8+
- "ArduinoCore-API/test/**"
9+
- "ArduinoCore-API/api/**"
10+
11+
push:
12+
paths:
13+
- ".github/workflows/unit-tests.yml"
14+
- "ArduinoCore-API/test/**"
15+
- "ArduinoCore-API/api/**"
16+
17+
jobs:
18+
test:
19+
name: Run unit tests
20+
runs-on: ubuntu-latest
21+
22+
env:
23+
COVERAGE_DATA_PATH: extras/coverage-data/coverage.info
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
29+
- name: Create link to String.h
30+
run: echo '#include "WString.h"' > ArduinoCore-API/api/String.h
31+
32+
- name: Create link to String.cpp
33+
run: echo '#include "WString.cpp"' > ArduinoCore-API/api/String.cpp
34+
35+
- name: Fix catch lib issues
36+
run: echo 'add_compile_definitions(CATCH_CONFIG_NO_POSIX_SIGNALS)' >> ArduinoCore-API/test/CMakeLists.txt
37+
38+
- name: Relax some warings
39+
# run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt
40+
# run: echo 'add_compile_options(-Wno-error=all)' >> ArduinoCore-API/test/CMakeLists.txt
41+
# run: echo 'add_compile_options(-Wno-error=unused-function)' >> ArduinoCore-API/test/CMakeLists.txt
42+
run: sed -i 's/-Werror//g' ArduinoCore-API/test/CMakeLists.txt
43+
44+
45+
# See: https://github.com/arduino/cpp-test-action/blob/main/README.md
46+
- uses: arduino/cpp-test-action@main
47+
with:
48+
source-path: ArduinoCore-API/test
49+
build-path: ArduinoCore-API/test/build
50+
runtime-path: ArduinoCore-API/test/build/bin/test-ArduinoCore-API
51+
coverage-exclude-paths: |
52+
- '*/test/*'
53+
- '/usr/*'
54+
coverage-data-path: ${{ env.COVERAGE_DATA_PATH }}
55+
56+
# Temporary excluded to prevent token requirement
57+
# See: https://github.com/codecov/codecov-action/blob/master/README.md
58+
#- name: Code coverage
59+
# uses: codecov/codecov-action@v3
60+
# with:
61+
# token: ${{ secrets.CODECOV_TOKEN }}
62+
# files: ${{ env.COVERAGE_DATA_PATH }}
63+
# fail_ci_if_error: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/build
2-
.*
2+
.vscode
3+

0 commit comments

Comments
 (0)