-
-
Notifications
You must be signed in to change notification settings - Fork 113
90 lines (83 loc) · 2.74 KB
/
build_check.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Integration Tests
on:
merge_group:
pull_request:
jobs:
build:
name: Compile Firmware
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: compile-cache
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install PlatformIO
shell: bash
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Checkout code
uses: actions/checkout@v3
- name: Build PlatformIO Project
run: pio run
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: firmware
path: .pio/build/lora_board/firmware.bin
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.10.2
with:
clang-format-version: '14'
check-path: src
cppcheck:
name: Run cppcheck
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: check-cache
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install PlatformIO
shell: bash
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Checkout code
uses: actions/checkout@v3
- name: Run PlatformIO Check
run: pio check --fail-on-defect high --fail-on-defect medium --fail-on-defect low -e lora_board
cppcheck-docker:
name: Run cppcheck in Docker
runs-on: ubuntu-latest
env:
CPPCHECK_ARGS: --enable=all --std=c++20 --suppress=*:*.pio\* --inline-suppr --suppress=unusedFunction --suppress=shadowFunction:*TimeLib.cpp --suppress=unreadVariable:*TimeLib.cpp --suppress=badBitmaskCheck:*project_configuration.cpp src
steps:
- name: checkout code
uses: actions/checkout@v3
- run: docker pull facthunder/cppcheck:latest
- name: Run cppcheck and print result
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck $CPPCHECK_ARGS"
- name: Run cppcheck and create html
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck --xml $CPPCHECK_ARGS 2> report.xml && cppcheck-htmlreport --file=report.xml --report-dir=output"
- name: Upload report
uses: actions/upload-artifact@v3
with:
name: Cppcheck Report
path: output