forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.61 KB
/
static-code-analyzer.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
name: Static Code Analyzer
on: [push, pull_request]
jobs:
run-static-code-analyzer:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
id: checkout
- name: Install cppcheck
id: install-cppcheck
if: always()
run: |
sudo apt-get install cppcheck
- name: Clone engine repository
id: clone-engine-repo
if: always() && steps.install-cppcheck.outcome == 'success'
run: |
cd ..
rm -rf postgresql_modified_for_babelfish
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
ENGINE_BRANCH=$GITHUB_HEAD_REF
else
ENGINE_BRANCH=$GITHUB_REF_NAME
fi
$GITHUB_WORKSPACE/.github/scripts/clone_engine_repo "$GITHUB_REPOSITORY_OWNER" "$ENGINE_BRANCH"
- name: Run cppcheck on extensions
id: run-cppcheck
if: always()
run: |
export NPROC=`nproc`
cppcheck --error-exitcode=-1 -j $NPROC --template=gcc \
--enable=warning --inline-suppr \
./contrib \
--suppress=nullPointerRedundantCheck \
--suppress=unknownMacro \
--output-file=cppcheck-failures.txt \
--include=../postgresql_modified_for_babelfish/src/include/utils/elog.h \
--include=../postgresql_modified_for_babelfish/src/include/c.h
- name: Upload failures as artifacts
id: upload-failures
if: always() && steps.run-cppcheck.outcome == 'failure'
uses: actions/upload-artifact@v2
with:
name: cppcheck-failures
path: ./cppcheck-failures.txt