-
Notifications
You must be signed in to change notification settings - Fork 396
76 lines (67 loc) · 2.55 KB
/
test_code_integrity.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
name: Code Integrity
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
code_integrity_checks:
name: Static Code Analysis
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++ source code.
uses: jidicula/clang-format-action@v4.14.0
if: always()
with:
clang-format-version: '10'
check-path: 'src/EnergyPlus'
- name: Run clang-format style check for C/C++ unit test code.
uses: jidicula/clang-format-action@v4.14.0
if: always()
with:
clang-format-version: '10'
check-path: 'tst/EnergyPlus/unit'
- name: Custom Check
if: always()
run: ./scripts/dev/custom_check.sh .
- name: Install cppcheck
if: always()
run: sudo apt-get install cppcheck
- name: Run CppCheck
id: cpp_check_run
if: always()
# TODO: Evaluate the long list of flags here
run: >
cppcheck
-D__cppcheck__ -UEP_Count_Calls -DEP_NO_OPENGL -UGROUND_PLOT -DLINK_WITH_PYTHON -DMSVC_DEBUG -DSKYLINE_MATRIX_REMOVE_ZERO_COLUMNS -U_OPENMP -Ugeneratetestdata
-DEP_cache_GlycolSpecificHeat -DEP_cache_PsyTsatFnPb -UEP_nocache_Psychrometrics -UEP_psych_errors -UEP_psych_stats
--force
--std=c++17
--inline-suppr
--suppress=missingInclude
--suppress=missingIncludeSystem
--suppress=unusedFunction:src/EnergyPlus/api/autosizing.cc
--suppress=unusedFunction:src/EnergyPlus/api/datatransfer.cc
--suppress=unusedFunction:src/EnergyPlus/api/func.cc
--suppress=unusedFunction:src/EnergyPlus/api/runtime.cc
--suppress=unusedFunction:src/EnergyPlus/api/state.cc
--suppress=unusedFunction:src/EnergyPlus/Psychrometrics.cc
--enable=all
-i EnergyPlus/DXCoils.cc
-i EnergyPlus/RefrigeratedCase.cc
-i EnergyPlus/SolarShading.cc
-j $(nproc)
--template='[{file}:{line}]:({severity}),[{id}],{message}'
--suppress="uninitvar:*"
./src
3>&1 1>&2 2>&3 | tee cppcheck.txt
- name: Parse and colorize cppcheck
if: always() && steps.cpp_check_run.outcome == 'success'
run: python ./scripts/dev/colorize_cppcheck_results.py
- name: Upload cppcheck results as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: EnergyPlus-${{ github.sha }}-cppcheck_results.txt
path: cppcheck.txt