-
Notifications
You must be signed in to change notification settings - Fork 57
55 lines (43 loc) · 1.4 KB
/
static-analysis.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
name: Static Analysis
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- main
pull_request:
jobs:
static-analysis:
name: Run cppcheck
runs-on: ubuntu-18.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
cppcheck: [all, psp]
steps:
- name: Install cppcheck
run: sudo apt-get install cppcheck -y
# Checks out a copy of the cfs bundle
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Run bundle cppcheck
if: ${{matrix.cppcheck =='all'}}
run: cppcheck --force --inline-suppr --quiet . 2> ${{matrix.cppcheck}}_cppcheck_err.txt
- name: psp strict cppcheck
if: ${{matrix.cppcheck =='psp'}}
run: |
cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw 2> ./${{matrix.cppcheck}}_cppcheck_err.txt
- name: Archive Static Analysis Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{matrix.cppcheck}}-cppcheck-err
path: ./*cppcheck_err.txt
- name: Check for errors
run: |
if [[ -s ${{matrix.cppcheck}}_cppcheck_err.txt ]];
then
cat ${{matrix.cppcheck}}_cppcheck_err.txt
exit -1
fi