From a77fedf6558f2973ed90f11d648e34a859c41646 Mon Sep 17 00:00:00 2001 From: Mario Hewardt Date: Wed, 6 Dec 2023 13:39:52 -0800 Subject: [PATCH] Add optional build parameter (#157) * Add optional build parameter * Skip vs. run * explicit set to true for static analysis * adding test logging * boolean case sensitivity --- azure-pipelines.yml | 1 + templates/build.yaml | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 66096f0..1453370 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -52,3 +52,4 @@ stages: - template: templates/build.yaml parameters: srcFolder: 'SysmonForLinux' + runStaticAnalysis: true diff --git a/templates/build.yaml b/templates/build.yaml index 589475b..07a4139 100644 --- a/templates/build.yaml +++ b/templates/build.yaml @@ -2,6 +2,8 @@ parameters: - name: srcFolder type: string default: '' +- name: runStaticAnalysis + type: boolean steps: - script: | @@ -25,7 +27,11 @@ steps: ./diag_script.sh& fi # -------------------------- TEMP DIAG END ---------------------------------------------------- - rm -rf build && mkdir build && cd build - scan-build cmake .. - scan-build -v --status-bugs -o verifier_result --exclude ../test --exclude openssl -disable-checker cplusplus.NewDelete,cplusplus.NewDeleteLeaks make + if [ ${{ parameters.runStaticAnalysis }} == True ]; then + rm -rf build && mkdir build && cd build + scan-build cmake .. + scan-build -v --status-bugs -o verifier_result --exclude ../test --exclude openssl -disable-checker cplusplus.NewDelete,cplusplus.NewDeleteLeaks make + else + echo "Skipping static code analysis." + fi displayName: "Static analysis of Sysmon source code" \ No newline at end of file